Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Beautiful Javascript

Name: Anonymous 2012-08-15 15:33

What's the most well written javascript you've ever seen?

 for me, its the d3 source code. All the design decisions are deeply thought out, resulting in a powerful declarative syntax thats easy to use, yet still scales to the most complex applications. I am devoting the next few years of my life to its study.

Name: Anonymous 2012-08-15 15:43

x=function () {
return "puts anus";
};

Name: Anonymous 2012-08-15 19:55

I like this code to loop through an array and do something with each element:

var arr = [1,2,3];

for (var i in arr) {
    // make sure the property is actually in the array object and not its prototype
    if (arr.hasOwnProperty(i)) {
        // now i contains the index of the current element, not the element itself
        var x = arr[i];

        // now we can do something with the element
        console.log(x);
    }
}


Javascript is such a beautiful and well-designed language.

Name: Anonymous 2012-08-15 20:15

These javashit spammers are worse than the feminist spammers. At least they were marginally funny.

Name: Anonymous 2012-08-15 20:22

>>3
for(var x of arr) console.log(x);

Name: Anonymous 2012-08-15 20:58

"" == true

Name: Anonymous 2012-08-15 23:45

>>5
Thanks, that's actually really helpful. JS still sucks, though.

Name: Anonymous 2012-08-16 1:34

>>7
It's one of those ``considered harmful'' practices. Try it on a DOM structure and you'll see what I mean. Javascript is shit.

Name: Anonymous 2012-08-16 13:32

>>8
i don't know what you're expecting from a design-by-committee ``me too'' language

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List