Working with Strings in JavaScript

preview_player
Показать описание
The fundamentals of how to work with Strings and String methods in JavaScript.
The reference that was used in this video was:
Рекомендации по теме
Комментарии
Автор

Thank you very much, the technique to use an empty string before concat is cool. will use it later.

rotrose
Автор

Amazing, do you have content for object orientated programming in javascript.

noonecares
Автор

Hello Steve, thanks for the previous responses. Regarding the first string. Wouldn't it be var string 1 = new String{"Toy Story"}

DmitriyMalayevProfile
Автор

When you create a string with new String("Toy Story"); it's an Object, so we can do
str1[15] = " ";
str1[16] = "2";
However when I console.log(String(str1)); I would expect to see Toy Story 2 but all I get is Toy Story. Is it because I'm trying to mutate a string?

adi
Автор

Is it correct to say all these strings are identical in every way?

let s1 = new String('Toy')
let s2 = String('Toy')
let s3 = 'Toy'

r1 = s1.toUpperCase()
r2 = s2.toUpperCase()
r3 = s3.toUpperCase()

console.log (s1, s2, s3) // Toy, Toy, Toy
console.log (r1, r2, r3) // TOY, TOY, TOY

johnywhy