Please click on the questions to see the answers
example"This" is not same as "this"
- Alert Box
- Confirm Box
- Prompt Box
Note that this backslash approach is not necessarily preferred, and possibly not universally supported.
Using document.write(), you can print the text in the screen.
Single Line Comments // and Multi-line comments start with /* and end with */.
Yes. ECMAScript 2015 introduced the const keyword, but it thus far only enjoys a smattering of browser .
const CONSTANT_VAR = "some-value";
The "===" operator is a binary logical operator to check whether the two values are same and are of same data type. It will return false even when their values are equal but they are not of same data type.
For ex: 555 and '555', according to the values are same but they are not of same data type, hence === will return false.
The above code return false
Primary Data Types
null is an assignment value. It can be assigned to a variable as a representation of no value:
A disabled element is unusable and un-clickable. Disabled elements are usually rendered in grey by default in browsers
If you want to access any element in an HTML page, you always start with accessing the document object. Finds the element with id="foo":
The getElementById() method returns the element that has the ID attribute with the specified value.
The reason is that Windows blocks one window or frame accessing another window or frame that is in a different domain.
The window object also has a screen object with properties describing the physical display. It can be used to display screen width, height, colorDepth, pixelDepth etc.
The encodeURI() function is used to encode a URI. It assumes that the input is a complete URI that might have some characters which need encoding in it. If you pass the result to decodeURI, the original string is returned.
The onDocumentReady allows you to execute code when only the DOM tree has been built, without waiting for images to load, while window.onload will wait until all assets have finished downloading, such as images and scripts.
The valueOf() method is used to get the primitive value of a string Object. This value is equivalent to String.prototype.toString().
Base(optional): An integer between 2 and 36 that represents the radix (the base in mathematical numeral systems) of the above mentioned string.
- What is noscript tag?
- Difference between '=', '==' and '===' operators?
- What is Browser Object Model
- How to test a string as a literal and as an object ?
- What is Associative Array? How do we use it?
- What's the Difference Between Class and Prototypal Inheritance?
- Event bubbling and Event Capturing in JavScript?