- 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
Found 8862 Articles for Front End Technology
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
211 Views
The stringify() function of a JSON object accepts a JSON string, and constructs an object based on the given text and, returns it.SyntaxIts Syntax is as followsJson.stringify();Example Live Demo JavaScript Example var jsonSample = '{Tutorial: Java, Version:8}'; jsonObj = JSON.stringify(jsonSample); document.write(jsonObj); Output"{Tutorial: Java, Version:8}"
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
130 Views
The JSON.parse() function accepts a JSON string, and constructs an object based on the given text and, returns it.SyntaxIts Syntax is as followsJson.parse();Example Live Demo JavaScript Example var jsonSample = '{"Tutorial": "Java", "Version":8 }'; jsonObj = JSON.parse(jsonSample); document.write("Tutorial Name: " + jsonObj.Tutorial); document.write(""); document.write("Tutorial Version: " + jsonObj.Version); OutputTutorial Name: Java Tutorial Version: 8
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
107 Views
Pseudo class is to show different state of an element or a css selector. visited pseudo class is to show that the link is already visited.This pseudo class is mostly being associated with link.Syntaxa:visited { color:green;}Let's check the actual usage of :visited pseudo class with different scenarios, as follows -Example Live Demo a:visited { color:green;} Click here to learn ExplanationWhen you first time see the link it will be shown with normal link color (Blue) and the link will turn green if this link has been visited once.Example Live Demo ... Read More
![Syed Javed](https://www.tutorialspoint.com/assets/profiles/13356/profile/60_64693-1512709676.jpg)
829 Views
Pseudo class is to show different state of an element or a css selector. Active pseudo class is to show that the element is in active state.This pseudo class is mostly being associated with link and button or any other element which can be active.For example if it is associated with link that the link is active.Syntaxa:active { color:green;}Let's check the actual usage of :active pseudo class with different scenarios, as follows −Example Live Demo a:active { color:green;} Click here to learn ExplanationWhen you first time see the link ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
382 Views
Fibonacci numbers are the numbers such that every number in the series after the first two is the sum of the two preceding ones. The series starts with 1, 1. Example −1, 1, 2, 3, 5, 8, 13, 21, 34, ….We can write a program to generate nth as follows −functionfibNaive(n) { if (n
![Samual Sam](https://www.tutorialspoint.com/assets/profiles/13514/profile/60_83486-1512649303.jpg)
2K+ Views
Dynamic programming breaks down the problem into smaller and yet smaller possible sub-problems. These sub-problems are not solved independently. Rather, results of these smaller sub-problems are remembered and used for similar or overlapping sub-problems. Dynamic programming is used where we have problems, which can be divided into similar sub-problems so that their results can be re-used. Mostly, these algorithms are used for optimization. Before solving the in-hand sub-problem, the dynamic algorithm will try to examine the results of the previously solved sub-problems. The solutions of sub-problems are combined in order to achieve the best solution. For a problem to be ... Read More
![Nikhilesh Aleti](https://www.tutorialspoint.com/assets/profiles/519798/profile/60_1221559-1663324574.jpg)
435 Views
Array is a linear data structure, which is able to store elements of different datatypes. Arrays are also defined as ordered collections. In array each of the value will be referred to as an element and those can be identified with index numbers. const array_name = [item1, item2, ...]; const movies = [Bahubali, RRR, KGF, Pushpa]; //Index values of above elements Bahubali – [0] RRR – [1] KGF – [2] Pushpa – [3] Loops is a programming element, there will be a sequence of instructions defined in the loop and it will continue to iterate till ... Read More
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
512 Views
Basically, multi-dimension arrays are used if you want to put arrays inside an array. Let's take an example. Say you wanted to store every 6 hour's temperature for every weekday. You could do something like:let monday = [35, 28, 29, 31]; let tuesday = [33, 24, 25, 29]; //...This is a good place to use a multidimensional array instead. A multidimensional array is nothing but an array of arrays. If we take forward our example, each row will represent a day while each entry in the row will represent a temp entry. For example, let temps = [ [35, ... Read More
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
142 Views
Let’s consider two cases while removing elements from an array. First, we will see how we can remove an element from the end of the array and in next section we will see how we can remove elements from the start of the array and from a given position of the element.Removing an element from the end of the arrayThis can be accomplished using the pop method. For example, let veggies = ["Onion", "Raddish"]; veggies.pop(); console.log(veggies);This will give the output −["Onion"]Removing an element from the start of the arrayThis can be accomplished using the unshift method. For example, let veggies ... Read More
![karthikeya Boyini](https://www.tutorialspoint.com/assets/profiles/13518/profile/60_31598-1537784993.jpg)
133 Views
Functions which have been commented out in this code. You can switch to those as well. We've also moved the Queue, Stack, and PriorityQueue classes in different modules that can be imported using either import statements or using require calls. Here is the complete implementation of the Graph class − Exampleconst Queue = require("./Queue"); const Stack = require("./Stack"); const PriorityQueue = require("./PriorityQueue"); class Graph { constructor() { this.edges = {}; this.nodes = []; } addNode(node) { this.nodes.push(node); this.edges[node] = []; } ... Read More