Strings Flashcards
1
Q
Assign the number of characters of txt to variable namd”x” then alert x.
var txt = “Hello World!”;
A
let x = txt.length; alert(x);
2
Q
Assign “we are “Vikings”” to a var named txt then alert it
A
let txt = "We are \"Vikings\""; alert(txt);
3
Q
Concatenate the two strings to alert “Hello World!”.
var str1 = "Hello "; var str2 = "World!";
A
alert(str1 + str2);