Rahul Sharma has Published 46 Articles

How to include an external JavaScript inside an HTML page?

Rahul Sharma

Rahul Sharma

Updated on 15-Jun-2020 11:48:03

2K+ Views

The HTML tag is used for declaring a script within your HTML document. Through this, you can define client-side JavaScript. But, what if you want to add external JavaScript inside an HTML Page? Well, you can easily do that too using the src attribute of the tag.The following ... Read More

How to Delete Bookmarks in your Browser (Firefox, Chrome)

Rahul Sharma

Rahul Sharma

Updated on 15-Jun-2020 08:51:40

186 Views

Bookmarks in a web browser are saved so that it can be referred. It is also known as favorite web pages. To Bookmark a web page, visit the page and press Ctrl+D. This will give you an option to save the web page.In this way, all the bookmarks get saved ... Read More

How to choose an HTML Editor?

Rahul Sharma

Rahul Sharma

Updated on 15-Jun-2020 08:27:06

176 Views

HTML Editors are WYSIWYG editor program which gives options to edit source code. Some of the well-known editors include Adobe Dreamweaver, CoffeeCup, KomodoIDE, EditPlus, etc. To choose an HTML Editor, you need to compare some of the features and find the best one to edit the source code.While choosing and ... Read More

Why avoid increment (“++”) and decrement (“--”) operators in JavaScript?

Rahul Sharma

Rahul Sharma

Updated on 15-Jun-2020 05:41:11

349 Views

The increment and decrement operators should be avoided since it can lead to unexpected results. Here are some of the conditions:In an assignment statement, it can lead to unfavorable results:ExampleLive Demo                    var a = 5;          var ... Read More

How to check a not-defined variable in JavaScript?

Rahul Sharma

Rahul Sharma

Updated on 15-Jun-2020 05:26:32

133 Views

To check a variable is ‘undefined’, you need to check using the following. If the result is “false”, it means the variable is not defined. Here, the variable results in “True” −ExampleLive Demo                    var points = 100;             if(points){                document.write("True");             }else{                document.write("False");             }          

How do you check if a variable is an array in JavaScript?

Rahul Sharma

Rahul Sharma

Updated on 13-Jun-2020 13:24:23

115 Views

To check if a variable is an array, use “instanceof. The following is the syntax −variable instanceof ArrayExampleLet’s seen an example to check if the variable “sports” is an array or not?                       var sports = [ "tennis", ... Read More

What is the yield keyword in JavaScript?

Rahul Sharma

Rahul Sharma

Updated on 13-Jun-2020 12:12:12

482 Views

The yield keyword is used in JavaScript to pause and resume a generator function. The value of the expression is returned to the generator's caller.Here are the Examples −function* displayRank () {    var selPlayers= [1, 2, 3, 4];    for (var a = 0; a < selPlayers.length; a++) { ... Read More

Why is 'class' a reserved word in JavaScript?

Rahul Sharma

Rahul Sharma

Updated on 13-Jun-2020 11:44:33

377 Views

The following are the future reserved words, which include ‘class’. These words are used as keywords in proposed extensions and are therefore reserved to allow for the possibility of future adoption of those extensions.class enum extends super const export ImportThe above is defined in the ECMAScript specification.In ECMAScript 6 Language ... Read More

How to name variables in JavaScript?

Rahul Sharma

Rahul Sharma

Updated on 13-Jun-2020 09:27:04

219 Views

Variables can be thought of as named containers. You can place data into these containers and then refer to the data simply by naming the container.While naming your variables in JavaScript, keep the following rules in mind.You should not use any of the JavaScript reserved keywords as a variable name. ... Read More

Variable Hoisting in JavaScript

Rahul Sharma

Rahul Sharma

Updated on 13-Jun-2020 09:22:57

153 Views

When you can use a JavaScript variable before it is declared, it is done using a technique called hoisting. The parser read through the complete function before running it.The behavior in which a variable appears to be used before it is declared is known as hoisting −For example, the following, ... Read More

Advertisements