Home
Q&A
Education
Technology
Credit
General
Health
Insurance
Questions
Ask a Question
Predict the output of the following JavaScript code. <script type="text/javascript"> var a="blogsforblog"; var x=a.lastIndexOf("b"); document.write(x); </script>
Home
Technology
Predict the output of the following JavaScript...
asked
Feb 27, 2021
in
Technology
by
JackTerrance
Predict the output of the following JavaScript code. var a="blogsforblog"; var x=a.lastIndexOf("b"); document.write(x); A) 8 B) 0 C) 9 D) Error
interview-question-answer
technology-questions-answers
1
Answer
0
votes
answered
Feb 27, 2021
by
JackTerrance
Ans: A Explanation: The index starts with 0 in JavaScript. Here, x searches for the last occurrence of “b” in the text.
Related questions
0
votes
Q: Predict the output of the following JavaScript code. <script type="text/javascript" language="javascript"> var x=5; var y=6; var res=eval("x*y"); document.write(res); </script>
Predict the output of the following JavaScript code.
Code A: var x = 10; y = --x + 1; alert(y); Code B: var x = 10; y = x-- + 1; alert(y); What is the output for code A and B? a)10,11 b)10,10 c)11,10 d)11,11...
asked
Oct 8, 2020
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: Predict the output. Hi {{name}}. is used with the context variable: var context = { "name" : "< b>Jane Roe< /b>" }
Predict the output. Hi {{name}}. is used with the context variable: var context = { "name" : "< b>Jane Roe< /b>" } (1)Jane Roe ... display (3)< b>Jane Roe< /b> (4)< b>Jane Roe< /b>...
asked
Aug 17, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: Which of the following is useful way to put text, code, data, output all in one document?
Which of the following is useful way to put text, code, data, output all in one document? (a) ... questions and answers pdf, Data Science interview questions for beginners...
asked
Oct 31, 2021
in
Education
by
JackTerrance
essential-data
science-interview-questions
data
science-interview-questions-answers
science-multiple-choice-questions
science-mcq-with-answers
science-mcq
core-data
science-questions
0
votes
Q: What is the HTML tag under which one can write the JavaScript code? A) <javascript> B) <scripted> C) <script> D) <js>
What is the HTML tag under which one can write the JavaScript code? A)
B)
C)
1. Predict the output of the following operations if x=5 and y=3. x>=10&& y>=4 f. x>=1 || y>=4 Select the correct answer from above options...
asked
Dec 21, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Predict the output of the following code snippet function foo(input: boolean) { let one = 1200; if (input) { let ans = one + 1; } return ans; }
Predict the output of the following code snippet function foo(input: boolean) { let one = 1200; if (input) { let ans ... 1. 1201 2. Undefined 3. Compilation error 4. Runtime error...
asked
Jun 29, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What is the output of the following expression? function multi(x,y) { var c = x*y; } multi(20,3);
What is the output of the following expression? function multi(x,y) { var c = x*y; } multi(20,3); 1. 20 2. 60 3. 3 4. Nothing...
asked
Feb 25, 2021
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: What is the output of the following expression? function multi(x,y) { var c = x*y; } multi(20,3);
What is the output of the following expression? function multi(x,y) { var c = x*y; } multi(20,3); A) 20 B) 60 C) 3 D) Nothing...
asked
Oct 9, 2020
in
Technology
by
JackTerrance
interview-question-answer
technology-questions-answers
0
votes
Q: Which of the following tool can be used for integrating text and code in one document?
Which of the following tool can be used for integrating text and code in one document? (a) knitr (b) ... questions and answers pdf, Data Science interview questions for beginners...
asked
Oct 29, 2021
in
Education
by
JackTerrance
essential-data
science-interview-questions
data
science-interview-questions-answers
science-multiple-choice-questions
science-mcq-with-answers
science-mcq
core-data
science-questions
0
votes
Q: (i) x=5, y=6,2=20Q8) Consider the following statements and describe the output/statement required:(a) To retrieve the data type of the inputted string “Covid 19” stored inside the variable Disease.(b) x,y=”99″, “9”,Find the concatenated value of x and y and also retrieve the address of x and y.(c) Q= “Class XI” * 3
(i) x=5, y=6,2=20 Q8) Consider the following statements and describe the output/statement required: ... multiple assignment statements. Select the correct answer from above options...
asked
Nov 27, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
...