hasClosing()
Wrap.prototype.hasClosing()
Wrap.prototype.hasClosing()Checks whether the primitive value of a specified object has the closing chars or given closing chars.
public hasClosing(closing?: string): boolean {
return (
this.#closing.length >= 1 &&
(typeof closing === 'string' ? this.#closing === closing : true)
);
}Parameters
closing?: string
closing?: stringOptional closing chars of a string type to check whether the primitive value contains them at the end.
Returns
The return value is a boolean indicating whether the primitive value has the closing chars or given closing chars.
Example usage
Given closing chars
closing charsLast updated
Was this helpful?