-
Just the other day I had a need to use arguments.callee and I realized that's not something you really see every day in JavaScript. Maybe I could talk about it a bit. Anonymous functions everywhere It's not news to anyone reading this blog that one of JavaScript's workhorses are anonymous...
-
This post is part of a series called JavaScript Demystified . Answer quick. Do you know what date is being created here? var year = '2009', month = '09', day = '01'; var date = new Date( parseInt(year), parseInt(month), parseInt(day) ); At first glance, it wouldn't surprising...
-
This post is part of a series called JavaScript Demystified . This particular chapter is further divided in two parts. Read Part 1 . Build your own hierarchy Let's pretend we are building some scripts that deal with musical instruments. We could define our own Guitar class type like this: //The constructor...
-
This post is part of a series called JavaScript Demystified . This particular chapter is further divided in two parts. Read Part 2 . In a previous installment in this series we saw how we could create constructor functions in JavaScript. Back then I just mentioned that we don't have classes in JavaScript...
-
This post is part of a series called JavaScript Demystified . I'm pretty sure by now you have heard at least once that eval is evil . Some nuggets from Eric Lippert's post: if you are considering using eval then there is probably a better way People, eval starts a compiler. I'm also pretty...
-
This post is part of a series called JavaScript Demystified . In our last installment in this short JavaScript series we took a look at closures. In some of the examples, we saw functions being declared (and returned) inside other functions. The capability of declaring a function inside another one is...
-
This post is part of a series called JavaScript Demystified . When I wrote about functions in JavaScript I mentioned that functions are more than just a block of code: Function is a standard data type in JavaScript, an object indeed; you can pass them around and copy them. Let's take a look at this...
-
This post is part of a series called JavaScript Demystified . Time after time I find JavaScript code that has bugs caused by lack of proper understanding of how functions work in JavaScript (a lot of that code has been written by me, by the way.) JavaScript has functional programming characteristics...