What are truthy and falsy values?
Simple meaning
Falsy values are false, 0, empty string, null, undefined, and NaN.
Open the full page for Why, Steps, Example and Key takeaway.
Panel-ready Frontend Master questions for freshers and experienced developers. Practice at Coding Cadre in Faridabad, or Online from Delhi NCR.
Falsy values are false, 0, empty string, null, undefined, and NaN.
Open the full page for Why, Steps, Example and Key takeaway.
Spread copies enumerable properties into a new object or array, which we use to update state immutably.
Open the full page for Why, Steps, Example and Key takeaway.
200 means success so I render the data.
Open the full page for Why, Steps, Example and Key takeaway.
It turns a JS value into a JSON string for APIs or localStorage.
Open the full page for Why, Steps, Example and Key takeaway.
It stops the browser's default action, like following a link or submitting a form.
Open the full page for Why, Steps, Example and Key takeaway.
Map returns a new array of transformed items and is the React list pattern.
Open the full page for Why, Steps, Example and Key takeaway.
Synchronous code runs on the call stack until it is empty.
Open the full page for Why, Steps, Example and Key takeaway.
Microtasks include Promise callbacks and queueMicrotask and they flush completely before the next macrotask.
Open the full page for Why, Steps, Example and Key takeaway.
Objects have an internal prototype link used when a property is missing.
Open the full page for Why, Steps, Example and Key takeaway.
It is the walk from an object to Object.prototype and then null while looking up a property.
Open the full page for Why, Steps, Example and Key takeaway.
I keep a timeout id, clear it on every call, and set a new timeout that fires the original function after wait ms.
Open the full page for Why, Steps, Example and Key takeaway.
Call and apply invoke the function now with a chosen this
Open the full page for Why, Steps, Example and Key takeaway.
I put one listener on a parent and use event.target to see which child was clicked.
Open the full page for Why, Steps, Example and Key takeaway.
StructuredClone is the modern built-in for many values.
Open the full page for Why, Steps, Example and Key takeaway.
Let and const exist in the scope from the start of the block but cannot be read until the declaration line.
Open the full page for Why, Steps, Example and Key takeaway.
Listeners can run on the way down from window to the target, then on the way up.
Open the full page for Why, Steps, Example and Key takeaway.
Cookies are small, sent with matching requests, and can be HttpOnly so JS cannot steal them.
Open the full page for Why, Steps, Example and Key takeaway.
A non-simple request triggers OPTIONS first.
Open the full page for Why, Steps, Example and Key takeaway.
A page can freely read data only from the same scheme, host, and port.
Open the full page for Why, Steps, Example and Key takeaway.
I pick interface for object shapes that might be extended or merged in declaration files.
Open the full page for Why, Steps, Example and Key takeaway.