Saturday, 15 September 2012

javascript - Add item to the beginning of the list -



javascript - Add item to the beginning of the list -

this question has reply here:

how can add together new array elements @ origin of array in javascript? 6 answers

i've been using next code add together new comment end of list:

ractive.push('blogposts.blogpostid.comments', newcomment);

but need add together item origin of list. i've looked through ractive documentation did not succeed in finding appropriate method.

use unshift method of array:

ractive.unshift('blogposts.blogpostid.comments', newcomment);

javascript ractivejs

No comments:

Post a Comment