Javascript: Set object & Loop

A Set object holds the unique values of any type like array or object. An array or any other iterable object can be passed to Set. – It’s a new data structure introduced in JavaScript ECMAScript 6 (ES6). – It has useful methods for iteration over the Set values. var mySet = new Set(); mySet.add(11); … Read more

Javascript: Map object & Loop

A Javascript Map object holds the key-value pairs of elements. An array or any other iterable object can be passed to the Map. – Map is a new data structure introduced in JavaScript ES6. – It’s an alternative to JavaScript Object for storing key/value pairs. – It has useful methods for iteration over the key/value … Read more

Javascript: Object & Loop

This article deals with creating a Javascript object and using different functions on the object. We also see how we can loop through the object and get the values. Create a new Javascript Object var myObject = { fruit: 'apple', flower: 'rose', vegetable: 'cabbage' }; console.log(myObject); // {fruit: "apple", flower: "rose", vegetable: "cabbage"} Access elements … Read more

Javascript: Check if a variable is an Array

This article shows how you can check if a Javascript variable is of an Array type. There are different ways to check if a variable is an Array in Javascript. 1) First way // define an array var myArray = [11, 'John']; console.log(Object.prototype.toString.call(myArray)); // [object Array] // check if the variable is an array if … Read more

Javascript: Check if a variable is an Object

This article shows how you can check if a Javascript variable is of an Object type. There are different ways to check if a variable is an Object in Javascript. 1) First way // define an object var myObject = {id: 11, name: John} console.log(Object.prototype.toString.call(myObject)); // [object Object] // check if the variable is an … Read more

Javascript: Multi-dimensional Array & Loop

This is a beginner tutorial on working with Javascript multi-dimensional arrays and looping through them. Javascript Array is a list-like object. It is used to store multiple values in a single variable. This article deals with creating a multi-dimensional Javascript array and using different functions on the array. We also see how we can loop … Read more

Javascript: Array & Loop

This is a beginner tutorial on working with Javascript arrays and looping through them. Javascript Array is a list-like object. It is used to store multiple values in a single variable. This article deals with creating a Javascript array and using different functions on the array. We also see how we can loop through the … Read more

Google Maps: Get Latitude/Longitude value on Click and on Mouse Move

This article shows how to get latitude and longitude value when you click or move the mouse over Google Map. In previous article, we had seen how we can Display Google Map with Marker when we have latitude and longitude value. Here, we will be using the same code to display the Google Map and … Read more

Google Maps: Create New Marker on Clicking the Map

This article shows how to create a new marker whenever you click or double click on the Google Map. In previous article, we had seen how we can Display Google Map with Marker when we have latitude and longitude value. Here, we will be using the same code and adding a new functionality of displaying … Read more