My notes                                                                                           https://learnjavascript.online/app.
html
           Strings I
           Note that .length should not have () after it because it is a property (a value that has already been computed).
           Whereas .toLowerCase() is a method that requires the () because it's an action that you are performing
           Since 2022, JavaScript now has a .at() method that reads the character at a certain index, which can also be
           negative
           const language = "JavaScript";
           language.at(0); // "J"
           language.at(1); // "a"
           language.at(-1); // "t"
           language.at(-2); // "p"
           You can also combine the character access with the .length property. So using the same language variable,
           here's how you get the second to last character from it:
           const language = "JavaScript";
           language[ language.length - 2 ]; // "p" because it's the second to last character from "JavaScript"
           const language = "JavaScript";
           language[ language.length - 2 ]; // "p" because it's the second to last character from "JavaScript"
             A substring is a part or a portion of a string.
             string.substring(indexStart, indexEnd) is used to return a portion of the string.
             indexStart: the position of the first character you'd like to include.
             indexEnd: the position of the first character you'd like to ignore.
             the indexEnd argument is optional which means you can leave it out.
             The + operator is used to add 2 numbers
             The + operator is used to concatenate 2 strings
           Note to self: Just a lil reminder, because it's always cool to remember =)
           Interpolation
           Template strings support interpolation! This means you could write a variable in your string, and get its
           value. The syntax is straightforward, you wrap your variable name with a dollar sign and curly braces. Let's
           take an example where we have a variable language with a value of JavaScript.
           let language = "JavaScript";
           `I am learning ${language}`; //"I am learning JavaScript";
             A template string is a string created with the backtick character: `
             Template strings can span multiple lines
             Template strings support interpolation with the ${variableName} syntax
           Show previous notes
1 de 1                                                                                                                5/6/2025, 8:10 AM