What is hoisting?
“Hoisting is a Java behavior that moves all of the function and variable declarations to the top.”
What is a type of operator?
“A typeof operator is a function that returns a string description to the type of a specific local or global variable.”
Explain the difference between a local variable and a global variable.
“A global variable can be accessed globally, e.g. throughout the entire program. A local variable can only be accessed from within the function or block where it was defined.”
What is strict mode and how is it activated?
“Strict mode'' is a helpful function that can be activated by adding the strong literal “use strict” above a file. When activated, strict mode highlights bad syntax by converting it into a real error in the system.” You will want to give an example, such as how a typo in a Java variable name can create a new global variable when strict mode is deactivated, whereas strict mode would highlight this typo as an error.
“An anonymous function is a function which is not bound to an identifier. This makes it a type of nested function and therefore requires closures for implementation.”
“This function displays log messages in the browser console.”
What is an undeclared variable?
“An undeclared variable is a variable that doesn’t exist at all. This differs from an undefined variable that exists but is yet to be defined.”
“Callbacks are functions that are scheduled for execution after another function has finished execution. This prevents functions from running before necessary tasks have been completed.”
What are asynchronous codes?
“Asynchronous codes are those that allow a program to be executed immediately, even if there is previous code being executed. Synchronous code requires that code being executed is completed before new code can be run.” This might lead to questions about the settimeout function, runtime, and runtime errors.
Explain the IsNaN function.
“The IsNaN function registers a DataFrame object, true or false. It will return an object true for ‘not a number’ or NaN where all values are replaced with boolean values. Otherwise, it will return false.”
“The process of debugging involves locating errors and abnormalities in programs so that they can be repaired.”
Explain the difference between function expressions and declarations.
“The biggest difference between a function declaration and a function expression is the fact that a function name can be omitted in function expressions to create an anonymous function.”
Explain the function of the following code operator: ===
“This is a strict code operator that will return true when two operands share a value without the need for conversion.”
Explain the function of VAR X.
“VAR X is used to declare a variable, with X being the name of the variable.” You may be provided sample code that uses the VAR X function. Explain the role of VAR X and explain the VAR keyword.
What is a constructor?
How would you merge strings?
“I would use the concatenation or concat() method to merge strings and create a single, larger string.”
What are function parameters and arguments?
When should arrow functions not be used?
“Arrow functions are not regular functions and they shouldn’t be used for object methods or callback functions. They can reduce the readability of code, but provide a shorter syntax for function declarations.” This question may be followed by follow-up questions about parameters, or other advanced topics.
What is the difference between foreach loop and for loop?
“A foreach loop processes each element in a wider collection in turn while a for loop can work outside of collection elements.”