Showing posts with label Literals. Show all posts
Showing posts with label Literals. Show all posts

Friday, 20 October 2017

JavaScript basics quick recap

JavaScript basics quick recap


JavaScript basics mindmap

1. Basics 

- Earlier known as LiveScript and then later changed into JavaScript by NetScape.

- Invented by Brendan Eich.

#1.1 ) Definition

- JavaScript (JS) is a popular client side scripting language. Client side scripting means all code get executed in the client's computer.
- It is an interpreted language, that means it does not need to be compiled.
- We can use JS to change the appearance of Web page like animation, effects on Webpage and interactive pages.
- It has many uses like Form Validations, Highly responsive interfaces such as interactive maps, animated 2D / 3D graphics, etc.

#1.2 )  Pros and Cons

[1] Pros
-  It is the first lambda language to go mainstream.
-  It is the language of the web browser.
-  It is lightweight and expressive.
- JavaScript has a very powerful object literal notation. Objects can be created simply by listing their components.
-  JavaScript is a loosely typed language, so JavaScript compilers are unable to detect type errors.

[2] Cons
-  JavaScript depends on global variables for linkage.

2) Grammar

#2.1) Whitespace
- It is used to separate sequences of characters that would otherwise be combined into a single token.
- Types of whitespace are :-
1. tab
2. space
3. line end
4. Comments
1.  block comments formed with /* */
2.  line-ending comments starting with //

#2.2) Names
- A name is a letter optionally followed by one or more letters, digits, or underbars.
- Names are used for statements, variables, parameters, property names, operators, and labels.
- A name cannot be a reserved word.


#2.3) Numbers
- JavaScript has a single number type. Internally, it is represented as 64-bit floating point, the same as Java's double that means  1 and 1.0 are the same value in JavaScript.

#2.4) Strings

- A string literal can be wrapped in single quotes or double quotes. It can contain zero or more characters.

- Strings are immutable that is once made, a string can never be changed. But it is easy to make a new string by concatenating other strings together with the + operator.  Two strings containing exactly the same characters in the same order are considered to be the same string that means,

'g' + 'i' + 'f' + 't' === 'gift'

- Strings have methods.

-  JavaScript does not have a character type. To represent a character, make a string with just one character in it.
- Strings have a length property. Example :  "five".length is 4.


To get the complete Mindmap diagram Click this link.

Chapter : 1 - First code in Node JS Previously I have written a blog about Getting Started with Node JS and its installation. Now lets s...