That’s Why I’m Loving JSLint!
While code-reviewing o2.js modules, I realized that I had done a serious mistake. … well, actually my “serious” mistake, turned out to be a “not that serious” caveat
Continue ReadingWhile code-reviewing o2.js modules, I realized that I had done a serious mistake. … well, actually my “serious” mistake, turned out to be a “not that serious” caveat
Continue ReadingString is a data type that any developer spends most of time working with. We format, we replace, we sanitize, we prettify, we trim, we encode, we decode, we serialize… Strings tirelessly, over and over And it’s virtually impossible to think about a JavaScript framework without some kind of a …
Continue ReadingWe’ve seen before that everything in JavaScript is an object. With a special exception. JavaScript‘s concept of “nothing”ness is a little confusing; since it defines two variables for non-existence: null, and undefined. And these two objects deserve a deeper look. null vs undefined undefined Any property that has not been …
Continue ReadingEach language has a way of doing the right things and doing things right; and JavaScript is no exception The main trick with JavaScript is to avoid taking the easy path. JavaScript is a versatile “language” and as the environment it is executed in is very forgiving, it is easy …
Continue ReadingReconsidering of the is function we created in our former eqality post, I realized that it’s a pretty reusable piece of code. Thus, I decided to create an o2.Validator module out of it.
Continue ReadingAt the end of this tutorial, you’ll be able to explain why the following code produces the associated output below — where the assert function prints “FAIL:” if its first parameter is falsey, and “PASS:” if it’s first parameter is truthy, as described in this Factory Pattern post: This code… …
Continue ReadingThe o2.Debugger that we’ve created a priori, has a single println method that simply outputs what’s sent to it as a parameter to the console or a selected DOM container. In this discussion, we’ll try to polish o2.Debugger further and add three utility methods: assert, error, and log. In the …
Continue ReadingYou can find the most up-to-date version of o2.js Core and the samples used in these tutorials at: https://source.o2js.com/svn/o2js.com/trunk/o2.js/ username: o2js password: o2js Just wanted to share, to those who want to follow the development process closer You can use any SVN client to connect to the repo. The username/password …
Continue ReadingHow to Declare a Function There are various ways to declare a JavaScript function: You can either declare with a function statement or with an anonymous function expression or by using a named function. //declare a function function sample(){} //a function expression var functionExpression = function(){}; //a named function var …
Continue ReadingI’ve updated the o2.Debugger object to adhere the module pattern that we’ve discussed before. You can click here, to get the source code (1.44K zipped archive) »» The updated source code is as follows: //create an o2 namespace if not alraedy created if(typeof o2 == 'undefined'){var o2={};} /** * o2.Debugger …
Continue Reading