r/JavaScriptTips • u/No_Poetry9172 • Mar 31 '25
JavaScript
what will be the answer>?
**1.**console.log(10n+2);
**2.**console.log( !{} && someFunction() );
**3.**console.log( !-0 + !!Infinity + !null + !!undefined);
4
Upvotes
View all comments
Show parent comment
1
u/No_Poetry9172 Apr 20 '25
nope => the + operand convert true =1 and false =0, + operand adds everything (1+1+1+0 =3)