Strings
let str = "hello world";
let spaceship = "artemis";
let strongPassword = "c<Db39)(-2?^#_=11MD.{[a"; // not my password
let emoji = "🦾🦵"; // yes this is valid, try itIndexing
let name = "dino";Square brackets
name[0]; // returns "d"
name[3]; // returns "o"
// Testing with other indices:
name[]; // no input - Uncaught SyntaxError: expected expression, got ']'
name[-2]; // negative number - returns undefined
name[2.7]; // decimal value - returns undefined
name[32]; // index out of range - returns undefinedThe charAt method
charAt methodThe at method
at methodString methods
Converting cases
Getting subsections
slice
slicesubstr
substrsubstring
substringChecking for substrings
String templating
Method 1:

Method 2: String concatenation

Method 3: String templating

Next steps
Last updated