
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
Monica Mona has Published 83 Articles

Monica Mona
2K+ Views
In mathematics, Greatest Common Divisor (GCD) is the largest possible integer, that divides both of the integers. The condition is that the numbers must be non-zero.We will follow the Euclidean Algorithm to find the GCD of two numbers.Input and OutputInput: Two numbers 51 and 34 Output: The GCD is: 17AlgorithmfindGCD(a, ... Read More

Monica Mona
1K+ Views
Methods which uses variable arguments (varargs, arguments with three dots) are known as variadic functions.ExampleLive Demopublic class Sample { void demoMethod(String... args) { for (String arg: args) { System.out.println(arg); } } public static void ... Read More

Monica Mona
570 Views
The telephone input type is used in HTML using the . Using this, allow the users to add telephone number.Note − The input type tel is only supported in Safari.ExampleYou can try to run the following code to learn how to use input type tel to allow user input in ... Read More

Monica Mona
2K+ Views
Let's create a MyMap class so that it doesn't hide the actual Map class in JS. We'll create a container object that'll keep track of all our values that we add to the map. We'll also create a display function that prints the map for us. Exampleclass MyMap { constructor() ... Read More

Monica Mona
10K+ Views
Now we'll create the put method that'll allow us to put key-value pairs on the dictionary. Now using this we'll implement the put method.Note that JS has objects that act quite like dictionaries. We can just set the container's key property to value. Exampleput(key, value) { this.container[key] = value; }You ... Read More

Monica Mona
3K+ Views
We'll implement the get method that searches a given key in the dictionary. Exampleget(key) { if(this.hasKey(key)) { return this.container[key]; } return undefined; }Again, JS objects are very much implemented like dictionaries, hence have most of the functionality we can use directly without any more code ... Read More

Monica Mona
2K+ Views
We'll implement a clear() function that simply clears the contents of the container. For example, Exampleclear() { this.container = {} }You can test this using − Exampleconst myMap = new MyMap(); myMap.put("key1", "value1"); myMap.put("key2", "value2"); myMap.display(); myMap.clear(); myMap.display();OutputThis will give the output −{ key1: 'value1', key2: 'value2' }You can ... Read More

Monica Mona
11K+ Views
Here we'll implement a for each function in our class and accept a callback that we can call on every key-value pair. Let's see how we can implement such a function − ExampleforEach(callback) { for (let prop in this.container) { // Call the callback as: callback(key, value) ... Read More

Monica Mona
219 Views
Use the Number() method in JavaScript to convert to Number. You can try to run the following code to learn how to convert -Infinity Number in JavaScript.ExampleLive Demo Convert -Infinity to Number var myVal = -Infinity; document.write("Number : " + Number(myVal)); OutputConvert -Infinity to Number Number : -Infinity