Skip to content

Instantly share code, notes, and snippets.

// 1: how could you rewrite the following to make it shorter?
// It can be done in one line, but it gets messy:
bar.[ foo? "doSomething" : "doSomethingElse" ]( el);
// 2: what is the faulty logic in the following code?
/*!
* m8 - JavaScript Math Library - v0.2
* by Kambfhase
* released under MIT License
*
* includes vice-versa by Andrea Giammarchi
*/
(function (Object, hasOwnProperty) {

This is a Walktrough of Evan Byrne's Class.js ( http://www.evanbyrne.com/article/class.js ). I comment the Code using //!. Please think of this walktrough as a help to avoid these mistakes in the future, not as an insult to the coder.

/*
* Class.js - Providing class structure for javascript
* Licensed under the General Public License (http://www.gnu.org/licenses/gpl.html)
* Copyright 2010 Evan Byrne (http://www.evanbyrne.com/article/class.js)
*/

Class.js, wow, that's creative. Ok, I admit my project names are shitty, too. :(

function Class(obj,args)

### Keybase proof
I hereby claim:
* I am kambfhase on github.
* I am kambfhase (https://keybase.io/kambfhase) on keybase.
* I have a public key whose fingerprint is 591C F1D3 FB6D B470 AF27 5C66 6E37 5E0C E9C0 22C8
To claim this, I am signing this object: