var defines a variable while let defines a constant.
There is no such major difference between them
The value of variable declared with let cannot be changed
var define function scoped variable while let define block scoped variable
Display()
Prompt()
Alert()
Confirm()
<!--This is a comment-->
//This is a comment
'This is a comment
#This is a comment
jscript.write("Sky is blue")
document.write("Sky is blue")
print("Sky is blue")
jscript.print("Sky is blue")
document. write()
console.log()
innerHTML
document.getElementById()
There is no such major difference between them.
The value of a variable declared with var can be changed while the value of a variable declared with let cannot be changed.
var defined function scoped variable while let define block scoped variable.
Displays a message in an alert box
Prints output to the console
Writes data to a file
Logs an error in the browser console
5myvalue
myvalue5
Myvalue
None of These
keyword
function
Declaration Statement
Data type
variable carName;
var carName;
vari carName;
dim carName;
Division by zero
Missing of semicolons
Syntax error
Both A and B
/* This is a comment */
Both A and C
Prints an exception error
Prints an overflow error
Displays “Infinity”
Prints the value as such
=
x
==
*
===
!=
22
4
2
syntax error
window. alert()
var
let
const
none of the above
if(a!=null)
if (!a)
if(a!null)
if(a!==null)
Volatile variable
Mutable variable
Immutable variable
Dynamic variable