answers 100% 2025
does the `ternary operator` looks like in javascript? - an expression ? This happens
when its true : This happens when its false
How to import a function from another module in JavaScript? - import {functionname}
from "./folder/filename"
What is a shallow copy on an object? - A copy whose properties share the same
references (point to the same underlying values) as those of the source object from
which the copy was made.
What is a callback function? Tell some examples of its usage. - A callback function is a
function that is passed as an argument to another function and is executed after some
kind of event.
setTimeout and addEventListeners are Callback functions
What is object destructuring in javascript? - Object destructuring in JavaScript is a
feature that allows you to extract properties from an object and assign them to variables
you can directly access them by their variable names rather than having to reference
them through the object.
What is array destructuring in javascript? - Allows extract elements from an array and
assign them to variables.
It uses a syntax similar to array literals, but with variable names instead of values.
What is the spread operator in `js` ? - It allows an iterable (such as an array or string) to
be expanded in places where zero or more elements (for arrays) or characters (for
strings) are expected.
What are the differences between the `arrow` function and the regular `function`? - You
cant call an arrowfunction before the declaration, but with the regular function you can
call it before you declare it
What is the `import` keyword used for? - To import bindings that are exported by
another module,
What is the `required` used for? - to include external modules that exist in separate files.
What are template literals? - Literals delimited with backtick ( ` ) characters, allowing for
multi-line strings, string interpolation with embedded expressions, and special
constructs called tagged templates