Home Posts tagged "property"
formats

The JavaScript “this” Keyword Deep Dive: Nested Methods

In an earlier article: The JavaScript “this” Keyword Deep Dive: Nested Functions, we learned how functions that are not methods evaluate “this” to the window object. In that post, we demonstrated that no matter how deeply you nest functions, this behavior is always the same. In this article, we will learn how the JavaScript “this”

(More)…

formats

Understanding Context in JavaScript – Object Literals

Why is the word “this” so important in JavaScript? In the post: “Understanding Scope in JavaScript,” I covered the basics of how scope works when dealing with functions. Sometimes the words “scope” and “context” are used interchangeably, which only leads to confusion because they are not the same thing. In JavaScript, “context” refers to an

(More)…

formats

Associative Arrays in JavaScript

You may be finding conflicting information about associative arrays in JavaScript. Well, the answer is quite simple…. and then things start to get a little odd If you are frustrated because you have been getting different answers on this subject, I”ve got good news and bad news. The good news is, the answer is simple:

(More)…

formats

How to Create a Name-Spaced Object to Avoid Using Global Variables in JavaScript

Creating your own custom Object is a good way to keep the global name-space clean and write organized code with predictable results. Sometimes you may need variables that are available to every function in your script. While it is tempting to use global variables to achieve this kind of scope, doing so can cause unpredictable

(More)…

show
 
close