-
-
Notifications
You must be signed in to change notification settings - Fork 806
/
Copy pathrepl.txt
57 lines (42 loc) · 1.59 KB
/
repl.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{{alias}}( value, searchValue[, position] )
Tests if an array-like value contains a search value.
When `value` is a string, the function checks whether the characters of the
search string are found in the input string. The search is case-sensitive.
When `value` is an array-like object, the function checks whether the input
array contains an element strictly equal to the specified search value.
For strings, this function is modeled after `String.prototype.includes`,
part of the ECMAScript 6 specification. This function is different from a
call to `String.prototype.includes.call` insofar as type-checking is
performed for all arguments.
The function does distinguish between positive and negative zero.
If `position < 0`, the search is performed for the entire input array or
string.
Parameters
----------
value: ArrayLike
Input value.
searchValue: any
Value to search for.
position: integer (optional)
Position at which to start searching for `searchValue`. Default: `0`.
Returns
-------
bool: boolean
Boolean indicating if an input value contains another value.
Examples
--------
> var bool = {{alias}}( 'Hello World', 'World' )
true
> bool = {{alias}}( 'Hello World', 'world' )
false
> bool = {{alias}}( [ 1, 2, 3, 4 ], 2 )
true
> bool = {{alias}}( [ NaN, 2, 3, 4 ], NaN )
true
// Supply a position:
> bool = {{alias}}( 'Hello World', 'Hello', 6 )
false
> bool = {{alias}}( [ true, NaN, false ], true, 1 )
false
See Also
--------