Posted On: Feb 22, 2018
Both the terms 'let' and 'var' are used for declaring the functions in JavaScript but the main difference between these two terms is that the 'let' is block scoped while a 'var' is the functional scope. It is not wrong to say that a variable represented with var is defined throughout the program in relation to let
Example of var:
Input: console.log(x); var x=5; console.log(x); Output: undefined 5
Example of let:
Input: console.log(x); let x=5; console.l og(x); Output: Error
Never Miss an Articles from us.
iOS swift is an intuitive and stalwart language for the iOS. It is joyful to deal with the writing stuff in Swift. It is very advanced and its syntax is also concise and expressive too...
It enables you to store the key-value pairs and access the value by providing the key.It is similar to that of the hash..
Basically, it is a type that contains a group of various related values under the same umbrella...