- Selenium
- JMeter
- DevOps
- VERSION CTRL
- ONLINE QUIZ
- Number System MCQ - 1
- Number System MCQ - 2
- Number System MCQ - 3
- Simplification MCQ - 1
- Average MCQ - 1
- Simple Interest MCQ - 1
- Compound Interest - MCQ
- Percentage - MCQ
- Ratio and Proportion - MCQ
- Profit and Loss - MCQ
- Time, Speed, and Distance - MCQ
- Time, and Work - MCQ
- Boats and Streams - MCQ
- General Knowledge Quiz - Indian Polity
- General Knowledge Quiz - History
- General Knowledge Quiz - Geography
- GK Quiz - Indian Polity - 2
- GK Quiz - Banking and Finance
- GK Quiz - Economics
- GK Quiz- Merger and Acquisition
- GK Quiz- International Bodies
- English Grammar quiz-1
- English Grammar quiz-2
- S/W PROJECT MANAGEMENT
- PROTRACTOR
- Java -Tutorials
- MORE
Javascript String - Quiz
MCQs(multiple choice questions) and quizzes on javascript string and string functions. Evaluate your expertise on JS strings.
This MCQ test covers topics like string declaration and other operations on strings.
Instructions
Topic- JS strings
The test consists of 14 questions.
No negative marking for this test.
No Time limit
The pass percentage is 70%
The correct answer with a description will be displayed after the answer has been marked.
Submit the test to calculate your score once you are done with all the questions.
Complexity Level- Moderate
Q1: Which of the following is the correct statement for string declaration in Javascript?
A. let a='hello';
B. let b="Hi";
C. let c = new String("Hi John");
A. let a='hello';
B. let b="Hi";
C. let c = new String("Hi John");
Q2: Which of the following is the correct statement that finds the string length in JavaScript?
let a='hello';
let a='hello';
Q3: Select whether the below JavaScript code is valid or not:
var x = "";
var x = "";
Q4: Select whether the below JavaScript code is valid or not:
let b ;
b="This is a string";
let b ;
b="This is a string";
Q5: What will be the console output of the below Javascript code after applying the javascript slice function on a string?
let str1 = "kiwi, Mango, Orange";
let str2 = str1.slice(5, 11);
console.log(str2);
let str1 = "kiwi, Mango, Orange";
let str2 = str1.slice(5, 11);
console.log(str2);
Q6: Select the correct javascript code that finds the substring of the given string:
let str = "avocado, kiwi, cucumber";
let str = "avocado, kiwi, cucumber";
Q7: Select the correct javascript code to replace the word "Maimi" with "California":
let str = "He visited Miami last week!";
let str = "He visited Miami last week!";
Q8: What will be the console output of the below Javascript code?
let str = "HELLO WORLD";
let char = str.charAt(2);
console.log(char);
let str = "HELLO WORLD";
let char = str.charAt(2);
console.log(char);
Q9: Which of the following code snippets correctly changes the string into uppercase in JavaScript?
let technogeeks = 'techno-geeks for quiz and mcq';
let technogeeks = 'techno-geeks for quiz and mcq';
Q10: What will be the console output of the below Javascript code?
let text = "HELLO WORLD";
let char = text.charCodeAt(0);
console.log(char);
let text = "HELLO WORLD";
let char = text.charCodeAt(0);
console.log(char);
Q11: Which string function is used to remove the whitespaces from both ends in the given javascript string?
let str1 = " techno-geeks! ";
let str1 = " techno-geeks! ";
Q12: split() function in javascript is used to ______
Q13: What will be the output of applying the startsWith() function on the below javascript string?
let str = "Hello geeks, welcome to the mcq world!";
str.startsWith("geeks");
let str = "Hello geeks, welcome to the mcq world!";
str.startsWith("geeks");
Q14: What will be the output of applying the includes() function on the below javascript string?
let str = "Hello geeks, welcome to the mcq world!";
str.includes("geeks");
let str = "Hello geeks, welcome to the mcq world!";
str.includes("geeks");