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: 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

Smarty: Selection list using foreach and section loop

In this article, I will be explaining about foreach and section loop used in Smarty. I will be using these loops for creating a selection list. We can create selection list from a custom Smarty function html_options. <select name="user"> {html_options values=$id output=$names selected="4"} </select> Instead of html_options, we can also use loops to create the … Read more