Logo

Javascript Questions Set 155:

Quiz Mode

Which of the following is not an assignment operator?

1
2
3
4

Solution:

Which Node object property returns the node immediately before a node?

1
2
3
4

Solution:

var str = "Please find where 'find' occurs!";

var pos = str.indexOf("John");

document.write(pos);

1
2
3
4

Solution:

What will be the output?

console.log("Space is " + typeof undefined + typeof null);

1
2
3
4

Solution:

What will be the output of the following JavaScript code?

<p id="demo"></p>
<script>
var x = 'It\'s';
document.getElementById("demo").innerHTML = x;
</script>

1
2
3
4

Solution:

What will be the output of the following JavaScript code?

var f = new java.io.File("/tmp/test");
var out = new java.io.FileWriter(f);
out instanceof java.io.Reader

1
2
3
4

Solution:

Which of the following do you think is the correct way of initializing dates

1
2
3
4

Solution:

How do you change the content of an HTML element with a specific ID?

1
2
3
4

Solution:

The React component lifecycle method that returns a true or false value based on certain conditions, which determines if the component should update or not. What is the name of this method?

1
2
3
4

Solution:

Predict the output:


const promiseA = new Promise((resolutionFunc, rejectionFunc) => { resolutionFunc(777); });

promiseA.then((val) => console.log("asynchronous logging has val:", val)); console.log("immediate logging");

1
2
3
4

Solution: