code: function sentenceCase(sentence) {
    var exciting = arguments.length <= 1 || arguments[1] === undefined ? false : arguments[1];
  
  
    // uppercase the first letter
    sentence = sentence[0].toUpperCase() + sentence.slice(1);
  
    if (['.', '!', '?'].indexOf(sentence.slice(-1)) > -1) {
      return sentence;
    } else if (exciting) {
      return sentence + "!";
    } else {
      return sentence + ".";
    }
  }
docs: Capitalise the first letter of the sentence and add a full stop.
  @param sentence
  @param exciting