Think about the following questions while you are reading:
- How can you create a function in Javascript?
In a simple language,to make a function we need a code starting with the keyword “ function ” followed by a parameter which is wrapped in the parentheses
as well as open/close brackets which holding the body of the code that are going to be executed after calling it at the end of the code.
meaning : 1-function 2-name the function(camelcase) 3-(parameters)4-{body of code} ex:function(var no1,var no2,….){set of codes}
- What is the difference between var and let in regards to scope?
var can be applied locally or globally to the block so it has a larger scope and its visible throughout the global scope,
while let is visible whiten the function and its been designed for local bindings only.
- What is a pure function?
the functions that have no side effects, and even doesn’t rely on side effects and just produces the value and dent modify the variable
outside it’s scope.
