- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Ayush Gupta has Published 541 Articles
![Ayush Gupta](https://www.tutorialspoint.com/assets/profiles/134135/profile/60_13095-1568350695.jpg)
Ayush Gupta
108 Views
The parseInt function available in JavaScript has the following signature −parseInt(string, radix);Where, the paramters are the following −String − The value to parse. If this argument is not a string, then it is converted to one using the ToString method. Leading whitespace in this argument is ignored.Radix − An integer ... Read More
![Ayush Gupta](https://www.tutorialspoint.com/assets/profiles/134135/profile/60_13095-1568350695.jpg)
Ayush Gupta
134 Views
This is not a feature of JavaScript but is Chrome's way of displaying uninitialized indexes in arrays (and array-like objects). For example, if you console.log the following −Exampleconsole.log(Array(100))Output[undefined × 100]This is better than printing [undefined, undefined, undefined,...] as it is more readable.
![Ayush Gupta](https://www.tutorialspoint.com/assets/profiles/134135/profile/60_13095-1568350695.jpg)
Ayush Gupta
127 Views
JavaScript allows you to add very advanced features to your web applications. For example, Drawing and manipulating graphicsAudio and Video APIs like HTMLMediaElement, the Web Audio API, and WebRTC allow you to do really interesting things with multimedia such as creating custom UI controls for playing audio and video, displaying ... Read More
![Ayush Gupta](https://www.tutorialspoint.com/assets/profiles/134135/profile/60_13095-1568350695.jpg)
Ayush Gupta
630 Views
According to MDN, An arrow function expression is a syntactically compact alternative to a regular function expression, although without its own bindings to the this, arguments, super, or new.target keywords. Arrow function expressions are ill suited as methods, and they cannot be used as constructors.There are 3 subtle differences in ... Read More
![Ayush Gupta](https://www.tutorialspoint.com/assets/profiles/134135/profile/60_13095-1568350695.jpg)
Ayush Gupta
255 Views
Javascript arrays are 0-indexed. This means that the first element is at the 0th position. The last element is at the length-of-array - 1th position. So we can access these elements using −Examplearr[0] // First element arr[arr.length - 1] // last element For example, let arr = [1, 'test', {}, ... Read More
![Ayush Gupta](https://www.tutorialspoint.com/assets/profiles/134135/profile/60_13095-1568350695.jpg)
Ayush Gupta
829 Views
Javascript specification doesn't specify a particular algorithm to be used in the Array.sort implementation. This is left on the implementor to decide. So different JS engines use different sorting algorithms.Mozilla(Spider Monkey JS engine) uses mergeSort. You can see the code written for it in C in the Mozilla repository: https://dxr.mozilla.org/seamonkey/source/js/src/jsarray.cWebKit(Chrome, ... Read More
![Ayush Gupta](https://www.tutorialspoint.com/assets/profiles/134135/profile/60_13095-1568350695.jpg)
Ayush Gupta
419 Views
The unshift method adds the element at the zeroeth index and shifts the values at consecutive indexes up, then returns the length of the array.The push() method adds the element at end to an array and returns that element. This method changes the length of the array.Examplelet fruits = ['apple', ... Read More
![Ayush Gupta](https://www.tutorialspoint.com/assets/profiles/134135/profile/60_13095-1568350695.jpg)
Ayush Gupta
386 Views
The shift method removes the element at the zeroeth index and shifts the values at consecutive indexes down, then returns the removed value. If the length property is 0, undefined is returned.The pop() method removes the last element from an array and returns that element. This method changes the length ... Read More
![Ayush Gupta](https://www.tutorialspoint.com/assets/profiles/134135/profile/60_13095-1568350695.jpg)
Ayush Gupta
337 Views
The basic difference between slice and splice is −splice() changes the original array on which it is called and returns the removed item(s) in an array as a new array object.slice() doesn't change the original array and also returns the array sliced.Example// splice changes the array let arr = [1, ... Read More
![Ayush Gupta](https://www.tutorialspoint.com/assets/profiles/134135/profile/60_13095-1568350695.jpg)
Ayush Gupta
165 Views
Shallow copy and deep copy are language agnostic. Shallow copies duplicate as little as possible. A shallow copy of a collection is a copy of the collection structure, not the elements. With a shallow copy, two collections now share the individual elements.Examplelet innerObj = { a: 'b', c: ... Read More