Underscore:
Underscore.js is a JavaScript library which provides utility functions for common programming tasks. It is comparable to features provided by Prototype.js and the Ruby language, but opts for a functional programming design instead of extending object prototypes.
Underscore consists of a little more than 100 functions, which fall under four main categories depending on the datatypes which they manipulate: functions for manipulating arrays, functions for manipulating objects, functions for manipulating both arrays and objects (the name of the category is "Collections") and functions for manipulating other functions. There are also two utility categories : "Utility" and "Chaining".
Example:
for example if we use javascript to achieve some functionality we need to write the below loop
var i,result = [];
for(i = 0; i < myArray.length; i++) {
var myObject = myArray[i];
if(myObject.isAwesome === true) {
result.push(myArray[i]);
}
}
The same functionality i can achieve with underscore.js without loop.
var result = _.filter(myArray, function(myObject) {
return myObject.isAwesome === true;
})
Underscore Reference : (http://underscorejs.org/)
Underscore.js is a JavaScript library which provides utility functions for common programming tasks. It is comparable to features provided by Prototype.js and the Ruby language, but opts for a functional programming design instead of extending object prototypes.
Underscore consists of a little more than 100 functions, which fall under four main categories depending on the datatypes which they manipulate: functions for manipulating arrays, functions for manipulating objects, functions for manipulating both arrays and objects (the name of the category is "Collections") and functions for manipulating other functions. There are also two utility categories : "Utility" and "Chaining".
Example:
for example if we use javascript to achieve some functionality we need to write the below loop
var i,result = [];
for(i = 0; i < myArray.length; i++) {
var myObject = myArray[i];
if(myObject.isAwesome === true) {
result.push(myArray[i]);
}
}
The same functionality i can achieve with underscore.js without loop.
var result = _.filter(myArray, function(myObject) {
return myObject.isAwesome === true;
})
Underscore Reference : (http://underscorejs.org/)
Excited words written in this blog helped me to improve my aptitudes and helped me to know how I can help myself all alone. I am truly happy to come at this stage. mobile app developers
ReplyDeleteHi,
ReplyDeleteThank you so much for taking effort to share such a useful information. I will definitely share this Web application Company Hyderabad .
Aapthi Technologies
This comment has been removed by the author.
ReplyDeleteThis is a great article thanks for sharing this informative information. I will visit your blog regularly for some latest post.
ReplyDeletemobile app development company in lahore
Thanks for the tip!
ReplyDeleteThat was pretty useful
Melbourne Web Developer
This is a notable guideline for both entrepreneurs and freelancers whose services are in demand! Great work! Thanks for sharing the info.
ReplyDeleteHire Dedicated Laravel Developer
Hire Dedicated Magento Developer
Smarty Developers
Hire Dedicated Developers
Hire Dedicated Web Developers
Today Telugu news updates provide us the information of breaking news and live updates. we get live news, political, education, technology, etc. Today Telugu news gives the best news updates. It also keeps its readers informed about the latest happenings in the world with instant updates
ReplyDeleteThanks for your great blog. But you can also find something new for ionic framework app development that is easily available and can learn very partly. It is cost-efficient and reduces the need for maintenance too.
ReplyDeleteInformation is pretty good and impressed me a lot. This article is quite in-depth and gives a good overview of the topic. If you facing difficultly to Directory Error in WordPressthan contact us.
ReplyDelete