Tuesday, April 21, 2015

jquery calculate percentage of array element and push percentage into other array

 var array = [20, 30, 40, 50, 60];
            var newarray = [];
            $.each(array, function (index, value) {
                newarray.push(value / 100);
            });

            console.log(newarray);

No comments:

Post a Comment