Subject

Programming Language

Practice related MCQ quizzes and improve step by step.

Quizzes in Programming Language

Considering the following snap of code, what is the expected result?

const gotNumber = 46;
if (gotNumber>45) {
    let division = 'Second Division';
}
console.log(`Division is ${division} by number ${gotNumber}`);
Correct answer(s):
    • Error: division is not defined


Considering the following snap of code, what is the expected result?

let dogName = 'Tom';
let catName = 'Jerry';
[dogName, catName] = [catName, dogName];
console.log(`Dog name: ${dogName}`);
Correct answer(s):
    • String output: Dog name: Jerry

When used as a constructor, like new MyFunction(), the value of this will be a brand new object provided by the JavaScript runtime. If we don’t explicitly return anything from that function, this will be considered its return value.

Correct answer(s):
    • true

What does the below line do considering it as the first line in your javascript file:

(function(){
    alert(this);
})();
Correct answer(s):
    • I will see an alert with not null value

What are true about WYSIWYG?

Correct answer(s):
    • WYSIWYG is an acronym for "what you see is what you get".
    • In 2012, Wikipedia offered a WYSIWYG editor called VisualEditor, which allowed edits of Wikipedia to be performed without seeing the page source.
    • WYSIWYG implies a user interface that allows the user to view something very similar to the end result while the document is being created.


Variable name resolving (number of significant characters for uniqueness of variable) depends on_____

Correct answer(s):
    • Compiler and linker implementation


Assume the following method is properly synchronized and called from a thread A on an object B:

wait(2000);

After calling this method, when will the thread A become a candidate to get another turn at the CPU?

Correct answer(s):
    • After thread A is notified, or after two seconds.