Objects
- Boolean.
- Number.
- toPrecision the number of significant digits to include.
- toExponential the total digits after precision.
- toFixed is the number of digits to print out after the decimal rounded.
- String.
- Date.
- Math.
Data Types
- For encoding and decoding we use decodeURI and ecodeURI.
- NaN is return when we multiply say two strings.
- When Object converted to Boolean, we get True.
- When we say alert(num) when num is not defined or initiated we get error but after we write var num; alert(num), we get undefined as a result.
- parseInt(num, base);
- const constant = value;
- newValue = oldValue >>> 3 Move bits of operand by 3 spaces right.
- & | ^ ~
- JavaScript 1.3 has strict equality and inequality operator === and !==.
- Short-circuit evaluation by placing the key expression or the less resource-intensive expression first when using logical AND/OR operators.
-
for (variable in object) { ... }
- The use of in also works with conditional tests.
Scripting Tag
- defer=”defer”: Not going to generate any document content, and the browser can continue processing the rest of the page’s content, returning to the script when the page has been processed and displayed. This is for speeding up page load.
- JavaScript Best Practice: Place all blocks of JavaScript code within external JavaScript files.
-
<script type="text/javascript"> //<![CDATA[ //]]> </script> <noscript> </noscript>
Basics
- Minimum JavaScript support to be expected is ECMA-262.
- Cross browser issues mainly due to difference in DOM and CSS implementation.
- MIME is Multipurpose Internet Mail Extension.
- JavaScript is case sensitive.
- BOM or Box Object Model is DOM version 0.