Found 6710 Articles for Javascript

How JavaScript was created?

Sravani S
Updated on 02-Jan-2020 08:00:13

174 Views

NCSA’s Mosaic was the first popular browser, which released in 1993. After a year, in 1994, Netscape was founded, which came with the web browser Netscape Navigator It gained a lot of popularity in the 1990s. Many Mosaic authors worked for Navigator.Considering the need for users and market trend, Netscape realized that the Web should be more dynamic. Netscape hired Brendan Eich in 1995In 1995, Netscape hired Brendan Eich to implement Scheme in the browser. But, Netscape collaborated with Sun to include Java, in Navigator. Netscape wanted to have a scripting language with a syntax similar to Java. Brendan Eich ... Read More

What is ECMAScript and how it is related to JavaScript?

V Jyothi
Updated on 02-Jan-2020 07:59:38

426 Views

JavaScript conforms to ECMAScript standard. JavaScript was first known as LiveScript, but Netscape changed its name to JavaScript, possibly because of the excitement being generated by Java. JavaScript made its first appearance in Netscape 2.0 in 1995 with the name LiveScript. The general-purpose core of the language embedded in Netscape, Internet Explorer, and other web browsers.The ECMAScript Edition 5 standard was the first update to be released in over four years. JavaScript 2.0 conforms to Edition 5 of the ECMAScript standard, and the difference between the two is extremely minor.The 8th edition, known as ECMAScript 2017, came in June 2017.The ... Read More

What was the name of JavaScript when it was created?

Priya Pallavi
Updated on 02-Jan-2020 07:59:07

1K+ Views

JavaScript launched in May 1995 by Brendan Eich, who used to work at Netscape. Initially, it wasn’t called JavaScript; it was given the name Mocha.The name Mocha was chosen by Marc Andreessen, a Netscape founder. The name was changed to LiveScript in September 1995. In the same year, December, it received a trademark license from Sun and the name JavaScript came into the picture.The general-purpose core of the language has been embedded in Netscape, Internet Explorer, and other web browsers.The ECMA-262 Specification defined a standard version of the core JavaScript language.JavaScript is a lightweight, interpreted programming language.Designed for creating network-centric ... Read More

How to check if a string has a certain piece of text in JavaScript?

Nikitha N
Updated on 12-Sep-2019 07:21:59

172 Views

The jQuery search() method is used to check whether a string contains a certain text in JavaScript.You can try to run the following code to check whether “Tutorialspoint: Free Video Tutorials” contains the “Free Video” text in JavaScript or not:           JavaScript String search() Method                        var re = "Free Video";          var str = "Tutorialspoint: Free Video Tutorials";          if ( str.search(re) == -1 ) {             document.write("Does not contain" );          } else {             document.write("Contains" );          }          

How to implement basic Animation in JavaScript?

Abhinanda Shri
Updated on 16-Jun-2020 06:25:09

151 Views

To implement basic Animation in JavaScript, use the DOM object properties and JavaScript. The following list contains different DOM methods.We are using the JavaScript function getElementById() to get a DOM object and then assigning it to a global variable imgObj.We have defined an initialization function init() to an initialize imgObj where we have to set its position and left attributes.We are calling an initialization function at the time of window load.Finally, we are calling moveRight() function to increase the left distance by 10 pixels. You could additionally set it to a negative value to move it to the left side.         ... Read More

How do I remove a particular element from an array in JavaScript

Revathi Satya Kondra
Updated on 10-Feb-2025 11:16:54

974 Views

In JavaScript, Removing a particular element from an array refers to the process of deleting or filtering out a particular element from the array. so that a element is no longer exists within that array. The Arrays are the most commonly used data structures in JavaScript, allowing developers to store and manipulate collections of items. Syntax Following is the syntax to remove a particular element from an array. array(index, deleteCount[, element1[, element2[, ...]]]) Parameters Here, we have three parameters to remove a particular element from an array in JavaScript − index − The index ... Read More

How to check whether a string contains a substring in JavaScript?

Abhinaya
Updated on 20-Apr-2022 12:44:47

893 Views

JavaScript provides us with different methods to check whether a string contains a substring or not. In this article, we use the following three methods for this purpose-String search() methodString indexOf() methodString includes() methodLet’s explore in detail each method.1. String search() methodThe string search method can be used to search a text (using regular expression) in a string.It matches the string against a regular expression and returns the index (position) of the first match.It returns -1 if no match is found. It’s case-sensitive.The string search() method is an ES1 feature. It is fully supported in all browsers.Syntaxstring.search(searchValue)searchValue is a regular ... Read More

Why do we use "use strict" in JavaScript?

Govinda Sai
Updated on 20-Apr-2022 12:30:05

730 Views

The “use strict” is a directive, which is a literal expression. It was introduced in JavaScript 1.8.5. As the name suggests, “use strict” indicates that the code is to be executed in strict mode.Benefits of using “use strict”It’s easier to write "secure" JavaScript codes.It changes previously accepted "bad syntax" into real errors. As an example, mistyping a variable name creates a new global variable. When using strict mode, this will throw an error. It leads to making it impossible to accidentally create a global variable.A programmer will not receive any error feedback assigning values to non-writable properties.But in strict mode, ... Read More

How to redirect to another webpage using JavaScript?

Ramu Prasad
Updated on 20-Apr-2022 12:40:56

21K+ Views

The window.location object contains the current location or URL information. We can redirect the users to another webpage using the properties of this object. window.location can be written without the prefix window.We use the following properties of the window.location object to redirect the users to another webpage −window.location.href- it returns the URL (href) of the current page.window.location.replace()- it replaces the current document with new document.window.location.assign() loads a new document.The syntaxes below are used to redirect to another web page. We omit the window prefix and use only location in all the program examples. You can try running the programs using ... Read More

Which equals operator (== vs ===) should be used in JavaScript comparisons

Sravani S
Updated on 12-Sep-2019 07:10:20

152 Views

Double equals (==) is abstract equality comparison operator, which transforms the operands to the same type before making the comparison.For example,4 == 4     // true '4' == 4   // true 4 == '4'   // true 0 == false // trueTriple equals (===) are strict equality comparison operator, which returns false for different types and different content.For example,4 === 4     // true 4 === '4'   // false var v1 = {'value': 'key'}; var v2 = {'value': 'key'}; v1 === v2   //false

Advertisements