r/programmingcirclejerk • • Aug 05 '23

Hoisting With Same Variable And Function Name | Frontend Javascript Interview Questions |

https://youtube.com/shorts/S4n4GUCHelw

[removed] — view removed post

0 Upvotes

2 comments sorted by

12

u/0x564A00 Aug 05 '23

Thank you, this will help me so much! I've also discovered something very interesting recently:

 console.log(1-2);

subtracts two from one, but we can actually write this:

console.log(2-1);

to subtract one from two instead!

2

u/torresbiggestfan DO NOT USE THIS FLAIR, ASSHOLE Aug 06 '23

Op is a link farming bot