Skip to main content

Bug Tracker

Side navigation

#13578 closed bug (notabug)

Opened March 07, 2013 10:54AM UTC

Closed March 07, 2013 09:25PM UTC

outputting arrays

Reported by: rudy.vanimpe@ugent.be Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.9.1
Keywords: Cc:
Blocked by: Blocking:
Description

Dear Sirs,

I got an unexpected result with the following code fragment:

$(document).ready(function() {

var colors = new Array("red","yellow");

var count = colors.unshift("black","white");

count = count.push("blue");

$('#30').click(function() {

$('#30a').text(colors);

});

var item = colors.shift();

$('#31').click(function() {

$('#31a').text(item + ", new length = "+colors.length);

});

})

When I click the button id = "30" I get the result "white,red,yellow,blue" , although it should be "black,white,red,yellow,blue".

When I click the button id="31" I get the correct result "black" and the correct new length of the array: 4

I sincerely hope this e-mail deserves your attention.

With kind regards,

Rudy Van Impe

Attachments (0)
Change History (1)

Changed March 07, 2013 09:25PM UTC by markelog comment:1

resolution: → notabug
status: newclosed

Don't know what you trying to do here, but this erratic code is definitely not jQuery's fault.