Opened 8 years ago

Closed 8 years ago

#15085 closed defect (duplicate)

strange behavior with concatenating 2 NodeLists

Reported by: ben hockey Owned by: Kris Zyp
Priority: undecided Milestone: tbd
Component: Query Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:

Description

based on the following markup:

<div id="one" class="nl1">one</div>
<div id="two" class="nl1">two</div>
<div id="three" class="nl2">three</div>
<div id="four" class="nl2">four</div>​

i've tried 2 different approaches to concatenating 2 NodeLists?

http://jsfiddle.net/neonstalwart/ZSyZS/ - produces an array with 2 elements - each element is an array of 2 nodes

require(['dojo/query'], function (query) {
    var nl1 = query('.nl1'),
        nl2 = query('.nl2'),
        concat = nl1.concat(nl2);
    
   console.log(concat);
});

http://jsfiddle.net/neonstalwart/ZSyZS/1/ - produces an array with 4 elements - 4 nodes

var query = dojo.query,
    nl1 = query('.nl1'),
    nl2 = query('.nl2'),
    concat = nl1.concat(nl2);

console.log(concat);

i would expect the first one to produce the same results as the 2nd one.

Change History (1)

comment:1 Changed 8 years ago by Karl Tiedt

Resolution: duplicate
Status: newclosed

Duplicate of #14555.
This is a duplicate of a ticket #14555

Note: See TracTickets for help on using tickets.