Hacker News new | past | comments | ask | show | jobs | submit login

In that context any kind of comparision would be a strawman unless is _your_ way of mixing jQuery with native code; maybe this would become more clear with different examples:

#Ex. 1

    $("div").map(function(){ return $(this).css('background-image'); })
"If you just want the background-image just use the get-computed-style-background-image!"

    [].slice.call(documents.getElementsByTagName('div')).map(function(a){ 
    	return getComputedStyle(a)["background-image"];
    });
#Ex. 2

    $("div").sort(function(a, b){
    	return $(a).find('*').length - $(b).find('*').length;
    });
"If you just want an algorithm that sorts the ones with the biggest amount of children and grandchildren just use an algorithm that sorts the ones with the biggest amount of children using domElement.getElementsByTagName"

    [].slice.call(documents.getElementsByTagName('div')).sort(function(a){ 
    	a.getElementsByTagName('*').length - b.getElementsByTagName('*').length;
    });

>And is not meant to be a wholesale replacement

I never said such thing neither; now that is 100% a straw-man.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: