Pre-release
AdventureJS Docs Downloads
Score: 0 Moves: 0
// getPreposition.js

(function () {
  /* global AdventureJS A */

  var p = AdventureJS.Dictionary.prototype;

  /**
   * Determine whether string is recognized as a preposition
   * and return the string.
   * @memberOf AdventureJS.Dictionary
   * @method AdventureJS.Dictionary#getPreposition
   * @kind function
   * @param {String} word
   * @returns {String|Boolean}
   */
  p.getPreposition = function Dictionary_getPreposition(word) {
    if (this.prepositions.includes(word)) return word;
    else return false;
  };
})();