Better HN
topnewbestaskshowjobs
Log inSign up

amochohan

3 karma · joined May 23, 2016 (10y ago) · 3 submissions

Submissions

comment 10y ago · link · parent

The reason I added this was because most developers are used to using a double pipe when writing code that has 'or' conditions.

I understand the use of pipes for bitwise, but in this case if you read the code in the example, we're basically saying "if the exception is of type A or of type B", personally I'd be inclined to use || if I didn't already know the syntax.

comment 10y ago · link · parent

Indeed it was a typo, i've now fixed that in the article. Thanks.

comment 10y ago · link · parent

I touched on the shortened [] syntax and non-numeric string arithmetic in the article.

Thank you for getting these added to the language, I think it's a fantastic improvement.