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

Pages: 1-

Javascript's "this" is garbage

Name: Anonymous 2011-08-07 11:38

An example (using chrome console)

> console.log("anus")
anus

> importantInfo = console.log
> importantInfo("anus")
TypeError

This fails because console.log needs a "this" that is console

> importantInfo = console.log.bind(console)
> importantInfo("anus")
anus

No big deal, but this comes up a lot if you do any javascript programming. Something will fail weirdly and it's because the dumb function wants a different "this". As a result, you're constantly binding functions because of uneccessary hidden coupling between things.

Name: Anonymous 2011-08-07 11:49

too bad your js shit is bloated

Name: Anonymous 2011-08-07 12:12

javascript is WEB SCALE

Name: Anonymous 2011-08-07 20:34

>>1
using browser I/O
blames shit syntax on the language
if you get tired of refreshing webpages to read program I/O then try this:
http://www.jsdb.org/

Name: Anonymous 2011-08-07 22:26

>>4

this issue has nothing to do with browser I/O. are you "trolling" me or something???F???U????C????K??????O????F????F????

Name: Anonymous 2011-08-07 22:35

<img onmouseover="Swapimage();" XRef="Newimage">
..
<script>
function Swapimage(){
this.src=loadPicture(this.XRef);
}

...This not too bad? =)

Name: Anonymous 2011-08-08 7:22

LOL... "Java Script is WEBSCALE" LOLOLOLOLOLOLOLOLOL

Web Scale is architecture based, not language based.

Think I'm joking?
- Explain Facebook, which uses PHP.

Where's your god now?

Name: Anonymous 2011-08-08 7:35

"this" and "new" are both garbage. Don't use them if you can help it.

Name: Anonymous 2011-08-08 11:12

malloc and scanf are both garbage.  Don't use them if you can help it.

Name: Anonymous 2011-08-08 14:16

>>9
except you really don't need this or new. You can use literal objects and closed over variables for all persistent values. And it's better.

Name: Anonymous 2011-08-08 17:01

<-- just got myself some dubz, losers

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