-
What are the different data types present in JavaScript?
There are two types of data types in JavaScript: Primitive data types The primitive data types are as follows: String: The string data type represents a sequence of characters. It is written within quotes and can be represented using a single or a double quote. Example: Number: The number data type is used to represent numeric values…
-
How to create a function in JavaScript?
To create a function in JavaScript, follow the following syntax.
-
How to write a comment in JavaScript?
There are two types of comments in JavaScript.
-
What is the use of history object?
The history object of a browser can be used to switch to history pages such as back and forward from the current page or another page. There are three methods of history object.
-
What is the use of window object?
The window object is created automatically by the browser that represents a window of a browser. It is not an object of JavaScript. It is a browser object. The window object is used to display the popup dialog box. Let’s see with description. Method Description alert() displays the alert box containing the message with ok…
-
What is DOM? What is the use of document object?
DOM stands for Document Object Model. A document object represents the HTML document. It can be used to access and change the content of HTML.
-
What is BOM?
BOM stands for Browser Object Model. It provides interaction with the browser. The default object of a browser is a window. So, you can call all the functions of the window by specifying the window or directly. The window object provides various properties like document, history, screen, navigator, location, innerHeight, innerWidth,
-
Is JavaScript case sensitive language?
Yes, JavaScript is a case sensitive language. For example:
-
How to use external JavaScript file?
I am assuming that js file name is message.js, place the following script tag inside the head tag.
-
What are the key differences between Java and JavaScript? / How is JavaScript different from Java?
JavaScript is a lightweight programming language (most commonly known as scripting language) developed by Netscape, Inc. It is used to make web pages interactive. It is not a part of the Java platform. Following is a list of some key differences between Java and JavaScript A list of key differences between Java and JavaScript Java…
