News for hackers. Stuff that matters.
Re:Vanilla JS, fast, lightweight, cross-platform framework by dotborg on Sunday August 26, 2012 @02:40PM (#4435814)
did you ever try to debug your pretty jquery karate?

ps. second example is not valid, in Vanilla JS you do it like this:

  document.getElementsByTagName('p').filter(function(el) {
    el.innerHTML = 'Hello.';
  });
Re:Vanilla JS, fast, lightweight, cross-platform framework by v413 on Sunday August 26, 2012 @03:00PM (#4435897)
The right way is this :)

Array.prototype.forEach.call(document.getElementsByTagName('p'), function(el) { el.innerHTML = 'Hello.'; });

Re:Vanilla JS, fast, lightweight, cross-platform framework by dasil003 on Sunday August 26, 2012 @08:00PM (#4436741)
I like how the end of that statement contains both a winking crooked-smile smiley next to black-eyed frown smiley.
Re:Vanilla JS, fast, lightweight, cross-platform framework by Skalman on Sunday August 26, 2012 @02:57PM (#4435880)
Nope:

TypeError: document.getElementsByTagName("p").filter is not a function

Because you don't get an array, only something array-like.

Re:Vanilla JS, fast, lightweight, cross-platform framework by vidarh on Sunday August 26, 2012 @03:51PM (#4436010)
And this discussion over how to write a trivial loop is why I stay far away from vanilla js unless performance absolutely forces me to optimize.
Re:Vanilla JS, fast, lightweight, cross-platform framework by tripzilch on Tuesday August 28, 2012 @08:13PM (#4446482)
This is why I program with a code editor / interactive console that tells me these things as I'm typing :-)