Skip to content
automailJS is a prototype extension for javascript lang
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
dist
src
test
.editorconfig
.gitignore
.travis.yml
Gruntfile.js
README.md
bower.json
karma.conf.js
package.json

README.md

AUTOMAIL JS Build Status

Automail JS is a prototype extension for js lang

Installation

  • Bower bower install -S automail

Table of extended Functions

  1. Array
  2. String

Array

  • contains
console.log([1,2,3].contains(2)); // => true
console.log([1,2,3].contains(9)); // => false
  • first
console.log([1,2,3].first()); // => 1
console.log([].first()); // => null
  • last
console.log([1,2,3].last()); // => 3
console.log([].last()); // => null
  • size
console.log([1,2,3].size()); // => 3
console.log([].size()); // => 0
  • isEmpty
console.log([1,2,3].isEmpty()); // => false
console.log([].isEmpty()); // => true
  • removeAt
var array = [1,2,3];
console.log(array.removeAt(1)); // => 2
console.log(array); // => [1,3]
  • remove
var array = [1,2,3];
console.log(array.remove(2)); // => 2
console.log(array); // => [1,3]

⬆ back to top

String

  • contains
console.log('automail'.contains('mail')); // => true
console.log('autoMail'.contains('mail')); // => false

// case insensitive
console.log('autoMail'.contains('mail', true)); // => true
  • capitalize
console.log('automail'.capitalize()); // => 'Automail'
  • startsWith
console.log('automail'.startsWith('auto')); // => true
console.log('AutoMail'.startsWith('auto')); // => false

// case insensitive
console.log('AutoMail'.startsWith('auto', true)); // => true

⬆ back to top

Something went wrong with that request. Please try again.