Please enable JavaScript.
Coggle requires JavaScript to display documents.
Javascript (8.function (function return (When JavaScript reaches a return…
Javascript
8.function
Function names can contain letters, digits, underscores, and dollar signs (same rules as variables).
Inside the function, the arguments (the parameters) behave as local variables.
-
function return
When JavaScript reaches a return statement, the function will stop executing.
-
-
Functions can be used the same way as you use variables, in all types of formulas, assignments, and calculations.
local variables
Variables declared within a JavaScript function, become LOCAL to the function.
Local variables can only be accessed from within the function.
-
7.Arithematic
-
When calculation is perfoming first multiplication is perform.then division and then modulus and then addition and substraction
-
-
6.null and undefined
1.a variable without a value, has the value undefined. The typeof is also undefined.
2.Any variable can be emptied, by setting the value to undefined. The type will also be undefined.
-
-
4.You can also break up a code line within a text string with a single backslash:
document.getElementById("demo").innerHTML = "Hello \
Dolly!"
A safer way to break up a string, is to use string addition:
-
Don't create strings as objects. It slows down execution speed.
The new keyword complicates the code. This can produce some unexpected results:
-
-
5.When using the === operator, equal strings are not equal, because the === operator expects equality in both type and value.
-
Note the difference between (x==y) and (x===y).
Comparing two JavaScript objects will always return false.
5.The typeof operator returns object for both objects, arrays, and null.
-
1.Variable declared without value will have undefined value.
2.If you re-declare a JavaScript variable, it will not lose its value.
3.If you put a number in quotes, the rest of the numbers will be treated as strings, and concatenated.
4.It's a good programming practice to declare all variables at the beginning of a script.
5.If you add a number and a string, the result will be a string!
6.JavaScript evaluates expressions from left to right