- A "Hello World!Hello World!Hello World!"
- B "Hello World!Hello World!Hello World!Hello World!Hello World!Hello World!"
- C "Hello World!"
- D "Hello World!Hello"
- Share this MCQ
Answer:
A
Share this MCQ
The repeat
method in JavaScript is a method that can be called on a string value to create a new string that is the specified number of copies of the original string.
In this case, the repeat
method is called on the string "Hello World!"
, with the number 3
as the argument.
The repeat method will create a new string that is 3 copies of the original string, resulting in the string "Hello World!Hello World!Hello World!"
.
Share this MCQ