0.0.3 • Published 10 years ago

coco-js v0.0.3

Weekly downloads
-
License
-
Repository
-
Last release
10 years ago

coco-js

coco-js adds the CoffeeScript prototype alias operator :: to JavaScript.

npm install coco-js

Examples

Array::slice.call("string")

/*
[
  's',
  't',
  'r',
  'i',
  'n',
  'g'
]
*/


var prop = 'slice';
Array::[prop].call("string")

/*
[
  's',
  't',
  'r',
  'i',
  'n',
  'g'
]
*/

var isString = function (obj) {
  return Object::toString.call(obj) === '[object String]'
}

isString('string') // true
isString([]) // false

Tests

make test

License

MIT

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago