
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 6710 Articles for Javascript

597 Views
The Stack property in JavaScript is used to store and keep track of the errors and saves the information such as the type of the error, where the error is raised and the reason of the error. The path of the origin of the error is also stored in the stacks in JavaScript. Stack is the error class property in JavaScript, which is also used to store the functions that are called, the order of the functions called too. The format of the error shown is as first, in the first line the type of the error will be displayed ... Read More

1K+ Views
The parseInt function available in JavaScript has the following signature −parseInt(string, radix);Where the parameters 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 between 2 and 36 that represents the radix (the base in mathematical numeral systems) of the string.If the radix parameter is omitted, JavaScript assumes the following −If the string begins with "0x", the radix is 16 (hexadecimal)If the string begins with "0", the radix is 8 (octal). This feature is ... Read More

635 Views
Both new Object() notation and Object literal({}) notations do the same thing. They initialize an object. However, the second notation can be a little different if you start adding properties to it.Examplelet a = { name: 'Ayush' }This initialization is equivalent to −let a = new Object(); a.name = 'Ayush'orlet a = {} a.name = 'Ayush'

728 Views
JavaScript programming language that is usually used for web scripting. It is a lightweight, interpreted programming language. JavaScript is one of the most programming languages for web development. For running JavaScript each browser has its own engine which enables the proper functioning of JavaScript in the browser. Some common Browsers and their JavaScript engines are −Spider Monkey for firefoxV8 for Google ChromeJavaScript code for SafariChakra for Microsoft Internet Explorer/ edgeTo make JavaScript universe and stop a browser from describing their own scripts. There is a standard set for JavaScript which will be used throughout the browser. there is an Association ... Read More

656 Views
To convert, use JSON.stringify(). Following is the code to convert MySQL DATETIME value to JSON format in JavaScript − var mySQLDateTime = new Date("Fri Sep 06 2019 22 −54 −48 "); var yearValue = mySQLDateTime.getFullYear(); var dateValue = mySQLDateTime.getDate(); var monthValue=mySQLDateTime.getMonth(); var hour=mySQLDateTime.getHours(); var minutes=mySQLDateTime.getMinutes(); var second=mySQLDateTime.getSeconds(); jsonObject={"year" −yearValue,"month" :monthValue,"DateValue" :dateValue,"Hour" :hour ,"Minutes" :minutes,"Second" :second}; var dateJsonObject = JSON.stringify(jsonObject); document.write(dateJsonObject); The screenshot of the code is as follows −This will produce the following output −{"year" :2019,"month" :8,"DateValue" :6,"Hour" :22,"Minutes" :54,"Second" :48}The snapshot of the output is as follows −

2K+ Views
Regardless of the programming language, memory life cycle is pretty much always the same −Allocate the memory you needUse the allocated memory (read, write)Release the allocated memory when it is not needed anymoreThe second part is explicit in all languages. Use of allocated memory needs to be done by the developer.The first and last parts are explicit in low-level languages like C but are mostly implicit in high-level languages like JavaScript.Hence there is no explicit way to allocate or free up memory in JavaScript. Just initializing objects allocates memory for them. When the variable goes out of scope, it is ... Read More

537 Views
Regardless of the programming language, memory life cycle is pretty much always the same −Allocate the memory you needUse the allocated memory (read, write)Release the allocated memory when it is not needed anymoreThe second part is explicit in all languages. Use of allocated memory needs to be done by the developer.The first and last parts are explicit in low-level languages like C but are mostly implicit in high-level languages like JavaScript.Hence there is no explicit way to allocate or free up memory in JavaScript. Just initializing objects allocates memory for them. When the variable goes out of scope, it is ... Read More

793 Views
In the JavaScript, Event Flow process is completed by three concepts −Event Target − The actual DOM object on which the event occured.Event Bubbling − Explained belowEvent Capturing − Explained belowEvent bubbling is the order in which event handlers are called when one element is nested inside a second element, and both elements have registered a listener for the same event (a click, for example). With bubbling, the event is first captured and handled by the innermost element and then propagated to outer elements.With capturing, the event is first captured by the outermost element and propagated to the inner elements.Let's ... Read More

1K+ Views
In JavaScript if the data is not an object and has no methods and properties is called as a primitive data type or a primitive value. The different types of primitive data types in JavaScript are string, number, Boolean, undefined, symbol, null and big int. The primitive types boolean, string and number can be wrapped by their wrapper object, i.e., instances of the Boolean, String and Number constructors respectively. To get the back the primitive values back from the object wrappers, we need to call the valueOf() method on the objects. Example Following example demonstrates the primitive and object types ... Read More

21K+ Views
Typecasting in JavaScript means converting one data type to another data type i.e., the conversion of a string data type to Boolean or the conversion of an integer data type to string data type. The typecasting in JavaScript is also known as type conversion or type coercion. Types of conversions The type casting is of two types in JavaScript. They are the implicit type conversions and the explicit type conversions. Implicit type casting The implicit type casting is the conversion of data type done due to the internal requirement or automatic conversion by the compiler or the interpreter. To understand ... Read More