- trim
- length
- charAt
- \t
- \n
- \\
String operations
examples/js/strings.js
"use strict"; console.log("a" + "b"); // ab console.log("abc".length); // 3 console.log('<' + " a b c " + '>'); // < a b c > console.log('<' + " a b c ".trim() + '>'); // <a b c> console.log("this is a long string".charAt(3)); // s console.log("this is a long string".charAt(0)); // t var x = "Hello "; var y = "World"; console.log(x + y); // Hello World
- length is an attribute
- trim() is a method
\t - tab \n - newline \" - to escape a quote \\ - to escpae a backslash
Note: + acts both on numbers and on strings