Different types of data have access to different abilities or methods CODE
Let's declare any string variable
let myString = 'Some String'
The string variable has access to all
string functions
document.write(myString.toUpperCase());
The result will be:
SOME STRING
But if we let number variable to use the string function
toUpperCase()
let myNumber = 55
console.log(myNumber.toUpperCase());
Then we will get the following error. This is because number type variable does not have access to string functions
Uncaught TypeError: myNumber.toUpperCase is not a function
by Valeri Tandilashvili
4 years ago
JavaScript
String functions
2
Pro tip: use ```triple backticks around text``` to write in code fences