Complete Js
Complete Js
20.95+7.99= 28.939999999998
(2095+799)/100=28.94
Asvised to use cents when calculating money and then convert back dividing by 100.
document.body.innerHTML("Hello") -> removes the content of the site and displays
hello.
Rounding:
Math.round(2.2)
2
Math.round(2.8)
3
((2095+799)*0.1)/100
2.894
Math.round((2095+799)*0.1)/100
string:
'hello'
can be concatenated
'hello'+'buddy'+ .....
'hellobuddy.....'
typeof 2
will give
'number'
typeof 'hello'
will give
'string'
'hello'+3
hello3(type coercion)
console.log() redirects code to console from any source file to the console on
website
js follows camelCase
typeof can also be used with variables to tell the type of value stored in that
variable.