← All posts
Tag
JavaScript
4 posts.
20264 posts
- The magic of call(), apply(), bind()user.greet() prints 'Hi, alice'. Pass the same function to setTimeout and it prints 'Hi, undefined'. Why this changes, and how call, apply and bind put you in control of it.
- Control Flow in JavaScript: If, Else, and Switch ExplainedYour bank app blocks a payment when your balance is too low. Your game says Game Over when your health hits zero. Every decision a program makes comes down to if, else and switch.
- Global vs GlobalThiswindow.myVar works in the browser. Run the same file in Node.js and it crashes: window is not defined. Same language, same global object, different names, and the one name that works everywhere.
- JavaScript Operators: The Basics You Need to KnowYou already know how operators work: you've used a calculator. JavaScript's version adds a compare mode, a logic mode and memory buttons, plus one button that trips up almost everyone.