Java and JavaScript are same language?
Topic: Basic JavaScript
Inside which HTML element do we put the JavaScript?
What will be output in console:
var animals = ['Tiger', 'Lion', 'Camel', 'Cow', 'Duck']; console.log(animals.slice(2, 4));
What is going to display with this js code:
var myArray = ['a', 'b', 'c']; console.log(myArray[-1]);
Which of these lines of code would replace the content of a webpage with “Saaaaaakib”?
What sort of data type does the document variable store?
When you’re writing JS on a webpage, what is the name of the global variable that represents the DOM?
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.
Apply or call method can be used to override the value of this?
What does the below line do considering it as the first line in your javascript file:
(function(){ alert(this); })();