Most usage things in JS
Variable, String methods, Number methods, math methods
- let: let is a block-level variable. let variables do not change or reassign for other blocks. the same variable name, but the different values on the different blocks. if variable declares inside of the block. then it’s doesn’t visible on the outside of the block. it works only inside of blocks.
- const: const stands for constant. it you assign a value in const type variable, then it’s cannot change.
- var: var is different from let & const. it works everywhere. Before ES6 its the only way to declare variables.
- isNaN(): it’s a special type of number object. it returns true or false. it stands for Not a Number.
- parseFloat() : it’s convert float number from string. its return floating/fractional value from string.
- parseInt() : it’s given only integer number value from string. it’s pick up before fractional point.
- toUpperCase(): if Your need a fully Upper case string, then you can use this build-in object for string. it converts fully string is upper case. Writing method: “string”.toUpperCase();
- toLowerCase(): if Your need a fully lower case string, then you can use this build-in object for string. it converts fully string in lower case. Writing method: “string”.toLowerCase();
- charAt() : charAt() can access every index character of the string. if you give input index number charAt() give you that’s index character. charAt(index)
- indexOf() : It’s gives you position/index of input substring. indexOf is Case sensitive. it it’s not in the total string. its output gives you -1.
- replace(): it’s can replace the substring of your string. string.replace(‘already have’, ‘which is replaced’)
- Slice(): total string to cut part of string or substring.