Word

Word

A Word is an iterable class that contains some text, its length, and relative word boundaries. Iterating over a Word will yield the word itself followed by the start and then end values.

Constructor

new Word(word, start, end)

Create a Word
Source:
Parameters:
Name Type Description
word string the string we will be using to create the Word
start number the beginning of the word relative to the content it was created from
end number the end of the word relative to the content it was created from

Methods

isValid() → {boolean}

Check if the word is valid
Source:
Returns:
Type:
boolean
True if the length of the word is greater than 0