Let's say I have an array var arr = [3,4,5,6,7,9]; , and I register the contents as follows:
$.each(arr, function(k, v) { console.log(v); }
When I register the contents, I want to check if the current value is greater than, for example, var limit = 5; .
If the current value is greater than limit , I want to replace / change this value to say the letter A and print it as such. Thus, my registered arr array will look like this: 3,4,5,A,A,A
I was thinking of something like this:
$.each(arr, function(k,v) { if (v > limit) {
I tried this, but it does nothing, no errors.
source share