Home Manual Reference Source

Function

Static Public Summary
public

isPalindrome(a: ArrayLike): *

Tests whether an array-like is a palindrome.

Static Private Summary
private

_isPalindrome(a: ArrayLike, i: number, j: number): *

Tests whether a slice of an array-like is a palindrome.

Static Public

public isPalindrome(a: ArrayLike): * source

Tests whether an array-like is a palindrome.

Params:

NameTypeAttributeDescription
a ArrayLike

Array-like input

Return:

*

boolean True if the input is a palindrome.

Static Private

private _isPalindrome(a: ArrayLike, i: number, j: number): * source

Tests whether a slice of an array-like is a palindrome.

Params:

NameTypeAttributeDescription
a ArrayLike

Array-like input

i number

Inclusive left bound

j number

Non-inclusive right bound

Return:

*

boolean True if the input slice is a palindrome.