Iggy of Pop of hip hop Iggy of Pop of hip hop - 1 year ago 110
Javascript Question

How do i replace something in array using jquery?

I have got this jquery array

var left=[1,2,3,4];

And i want to replace
element with

Answer Source

You need to use map function here. Try this:

var left = [1,2,3,4];

result = left.map(function(item) { 
    return item == 3? 7: item;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download