+ 2

JavaScript

(O) => (O) <= (O) what is this doing ??? compiles with no errors )

30th Jan 2018, 8:25 AM
Sokrat Poghosyan
Sokrat Poghosyan - avatar
3 Answers
+ 1
Nothing. => is an operator in JavaScript, but <= is not.
30th Jan 2018, 7:19 PM
Tom Shaver
Tom Shaver - avatar
+ 1
Sorry, I thought this was an emoji, but it's just ES6. In a more readable form it's something like (function (O) { return O <= (O) })() And closer to full-on crazy ES6 (O) => { return O <= (O) } So, it's immediately executing and returning a Boolean value based on comparing O to itself (if this is the actual code), but not returning to anything so the value is just ignored.
31st Jan 2018, 11:30 AM
Tom Shaver
Tom Shaver - avatar
0
but it’s compiling without any errors
30th Jan 2018, 7:20 PM
Sokrat Poghosyan
Sokrat Poghosyan - avatar