background preloader

Javascript

Facebook Twitter

Object.call(Carlos); sur Twitter : "Me he grabado resolviendo problemas de #JavaScript, a ver si os gusta #pleaseRT □□□□ Resolviendo problemas de JavaScript | Parte I. Plus.google. Plus.google. Plus.google. Plus.google. Plus.google. Plus.google. Seven JavaScript Things I Wish I Knew Much Earlier In My Career. Advertisement I’ve been writing JavaScript code for much longer than I care to remember. I am very excited about the language’s recent success; it’s good to be a part of that success story. I’ve written dozens of articles, book chapters and one full book on the matter, and yet I keep finding new things. Here are some of the “aha!” Shortcut Notations One of the things I love most about JavaScript now is shortcut notations to generate objects and arrays.

Var car = new Object(); car.colour = 'red'; car.wheels = 4; car.hubcaps = 'spinning'; car.age = 4; The same can be achieved with: Much shorter, and you don’t need to repeat the name of the object. The other handy shortcut notation is for arrays. Var moviesThatNeedBetterWriters = new Array( 'Transformers','Transformers2','Avatar','Indiana Jones 4' ); The shorter version of this is: var moviesThatNeedBetterWriters = [ 'Transformers','Transformers2','Avatar','Indiana Jones 4' ]; This is not Sparta; this is madness—don’t bother with this.

Resources.

Iframe

Aim. Color.