stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
concatenation in JS Flashcards | StudBud
Explore
/
concatenation in JS
concatenation in JS
10 terms
·
StudBud Administration
·
114 plays
concatenation in JS
Flashcards
10 cards
F
Practice quiz
P
Host live
L
Questions
10
Answers
1
2.Which of the following is the correct way to concatenate two strings in JavaScript?
str1 & str2
str1 + str2
str1 * str2
str1 - str2
2
5. Which of the following will concatenate the string "Hello" and "World" with a space between them?
All of the above
console.log("Hello" .concat("World"));
console.log("Hello"+ " " + "World");
console.log("Hello"+ "World");
3
3. What will the following code output?
AliceJohnson
Alice, Johnson
Alice - Johnson
Alice Johnson
4
What is the output of the following code?
The quick brown fox
The quick brown foxes
Thequick brownfox
The quickbrown fox
5
Which operator is used to concatenate strings in JavaScript?
*
/
&
+
6
How can you insert a variable into a string in JavaScript?
Using the + operator only
Using concat() method only
Using template literals with ${}
You cannot insert variables into strings
7
1. What will be the output of the following code?
Hello World
HelloWorld!
HelloWorld
Hello, World
8
Which of the following methods can you use to concatenate strings in JavaScript?
Template literals
All of the above
+ operator
.concat()
9
4. What is the purpose of template literals in JavaScript?
To perform mathematical operations
To concatenate strings easily
To define variables
To declare functions
10
What will the following code print to the console?
Java + Rocks!
JavaScriptRocks!
JavaScript Rocks!
Java Script Rocks!