bower
Version:
The browser package manager
64 lines (41 loc) • 1.17 kB
Markdown
> Returns `true` if the given `string` or `array` ends with `suffix` using strict equality for comparisons.
```bash
npm i ends-with --save-dev
```
This uses the fasted version of 9 different [implementations](benchmark/implementations) that were benchmarked.
```bash
node benchmark
```
```bash
npm test
```
```js
var endsWith = require('ends-with');
endsWith('abc', 'c');
//=> true
endsWith(['a', 'b', 'c'], 'c');
//=> true
endsWith(['abc', 'abc', 'abc'], 'c');
//=> false
endsWith(['abc', 'abc', 'abc'], 'c');
//=> false
endsWith(['a', 'b', 42], 42)
//=> true
endsWith(['a', 'b', 42], '42')
//=> false
```
**Jon Schlinkert**
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
***
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 06, 2014._