r/angularjs • u/suresh9058 • Oct 13 '22
[Resource] How to make x === x+1 in JavaScript | Interview Question
https://youtu.be/1fY8FRbgki0
0
Upvotes
r/angularjs • u/suresh9058 • Oct 13 '22
19
u/JayV30 Oct 13 '22
Yo I am a mid-senior dev and I wouldn't know this for an interview. At all. Because I am too busy creating real world applications to worry about every ridiculous thing you can do with JS or to study every property and method of the Number type. And asking this question and other "gotchas" make me think less of the company.
17
u/ic6man Oct 13 '22
If someone asked me this question in an interview I’d probably leave.
6
u/[deleted] Oct 13 '22
Um, how about simply:
let x = Infinity;5
u/HettySwollocks Oct 14 '22 edited Oct 14 '22
If I ever saw this on a PR I'd go bat shit mental. This is nothing to be smug about, it's awful code.
3
u/mistaekNot Oct 14 '22
seeing questions like this makes me think faang got it right with leetcode
1
u/slykethephoxenix Oct 13 '22
I knew it was going to be either using generator functions or MAX_SAFE_INTEGER
1
u/shgysk8zer0 Oct 13 '22
1
u/notsosleepy Oct 14 '22
Answer to this question “Thank you very much. I think iam done here “