
I feel so privileged being able to use Linq group by statements when I’m working in C# to quickly and easily group a list of objects; however, when it comes to Javascript Arrays, it’s not quite so easy.

I feel so privileged being able to use Linq group by statements when I’m working in C# to quickly and easily group a list of objects; however, when it comes to Javascript Arrays, it’s not quite so easy.
jQuery’s $.map() function is a pretty neat function. It accepts a JavaScript array as a parameter and then will iterate through each item in the array allowing you to further manipulate and build a new array with that data. This article will explore how to use it while providing a useful example.
The Javascript concat method is a great function and this article will hopefully answer your burning question of how do you concatenate strings in javascript?
(more…)
Javascript contains a built-in array method to sort simple arrays. But I rarely am using simple JavaScript arrays, typically the elements inside my array a complex objects with many different properties. A simple example is a person that perhaps contains a first name, last name, and age. I can see myself wanting to sort by any one of those properties. So how can I sort a JavaScript array that contains complex objects and better yet, not hard-coded and dynamically by any property of my object.
I have rarely wanted to randomize an array with Javascript; however, whenever I do I forget how to do it. Today that day changes, I’m going to write it down to both help my memory as well as have an easy place to find it in the future. Alright, let’s look at a simple solution to randomizing or shuffling a Javascript array.