-
Loop Syntax in jQuery
jQuery 3.0 is the most newest version of jQuery. There are many changes in it, but one of the important change
is the syntax of loop using for..of loop.For example earlier we use the syntax shown below:-
var $divelements = $("div");
for (var x=0; x< $divelements.length; x++){
$divelements[x].addClass("dummy");
}Here's the new syntax:-
var $divelements = $("div");
var i = 0;
for(var elm of $divelements) {
elm.addClass("dummy");
}With the help of this new syntax, you will get DOM elements, instead of jQuery collection. You not need to use index to get element, it will be directly accessible to you.
- This discussion was modified 8 years, 1 month ago by Sourabh.
- This discussion was modified 8 years ago by Forcetalks.
Log In to reply.
Popular Salesforce Blogs
How to implement Salesforce Communities
Salesforce Communities is now considered as an important requirement that helps businesses to establish a connection with their customers, partners as well as employees. Specific…
Data Management in Salesforce - Here is All You Need to Know
This is the important part to understand clearly as an administrator. In this blog we are going to learn about how the data is imported…
Mission Three: Multi-Dimensional Quoting (MDQ) and Quote Line Groups | Salesforce CPQ
Video 3: Managing Subscription Products with Salesforce CPQ Mission Three: Multi-Dimensional Quoting (MDQ) & Quote Line Groups Hey, Salesforce enthusiasts! As promised, we are back…
Popular Salesforce Videos
How to Transform Sales Processes with Salesforce Anywhere
Salesforce Anywhere – a real-time interface that extends the power of Salesforce – is here to give sales leaders more visibility into what’s going on…
Introduction to SOQL in Salesforce
This video explains what is SOQL or Salesforce Object Query Language in Salesforce technology with examples from daily life for your better understanding .
Google Home Assistant Integration with Salesforce
Check out the below link for pdf view. https://www.linkedin.com/pulse/google-home-assistant-integration-salesforce-rajkiran-dewara/