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);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Assign “we are “Vikings”” to a var named txt then alert it

A
let txt = "We are \"Vikings\"";
alert(txt);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Concatenate the two strings to alert “Hello World!”.

var str1 = "Hello ";
var str2 = "World!";
A

alert(str1 + str2);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly