What will be the value of out after executing the code?
var msg = "Welcome to Quizful"; 
var out = msg.substr(3, 3);
Explanation
JavaScript String substr() Method extract a part of the string, starting at the character at the specified position and returns the specified number of characters.
Example:
var string = "quizful";
var newString = string.substr(0,4);
console.log(newString); // will print "quiz" to console.

@Vadim_Klimets Thanks!

2017 May 18, 12:26:24 AM

A semicolon '';" is missing after console.log(newString).

2017 Apr 30, 12:05:19 PM

Следи за CodeGalaxy

Мобильное приложение Beta

Get it on Google Play
Обратная Связь
Cosmo
Зарегистрируйся сейчас
или Подпишись на будущие тесты