Prototypes.coffee 317 B

12345678910
  1. String::startsWith = (s) -> @[...s.length] is s
  2. String::endsWith = (s) -> s is '' or @[-s.length..] is s
  3. String::capitalize = -> if @.length then @[0].toUpperCase() + @.slice(1) else ""
  4. String::repeat = (count) -> new Array( count + 1 ).join(@)
  5. window.isEmpty = (obj) ->
  6. for key of obj
  7. return false
  8. return true