Automail JS is a prototype extension for js lang
- Bower
bower install -S automail
- 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]
- 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