Most usage things in JS

Variable, String methods, Number methods, math methods

Minhazul Abedin
2 min readMay 5, 2021
  1. 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.
  2. const: const stands for constant. it you assign a value in const type variable, then it’s cannot change.
  3. var: var is different from let & const. it works everywhere. Before ES6 its the only way to declare variables.
  4. isNaN(): it’s a special type of number object. it returns true or false. it stands for Not a Number.
  5. parseFloat() : it’s convert float number from string. its return floating/fractional value from string.
  6. parseInt() : it’s given only integer number value from string. it’s pick up before fractional point.
  7. 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();
  8. 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();
  9. 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)
  10. 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.
  11. replace(): it’s can replace the substring of your string. string.replace(‘already have’, ‘which is replaced’)
  12. Slice(): total string to cut part of string or substring.

--

--