apps/voice-recognition/public/speech.js
function(commandsToRemove) {
      if (commandsToRemove === undefined) {
        commandsList = [];
        return;
      }
      commandsToRemove = Array.isArray(commandsToRemove) ? commandsToRemove : [commandsToRemove];
      commandsList = commandsList.filter(function(command) {
        for (var i = 0; i<commandsToRemove.length; i++) {
          if (commandsToRemove[i] === command.originalPhrase) {
            return false;
          }
        }
        return true;
      });
    }
function(commandsToRemove) {
      if (commandsToRemove === undefined) {
        commandsList = [];
        return;
      }
      commandsToRemove = Array.isArray(commandsToRemove) ? commandsToRemove : [commandsToRemove];
      commandsList = commandsList.filter(function(command) {
        for (var i = 0; i<commandsToRemove.length; i++) {
          if (commandsToRemove[i] === command.originalPhrase) {
            return false;
          }
        }
        return true;
      });
    }
function ( commandsToRemove ) { if ( commandsToRemove === undefined ) { commandsList = [ ] ; return ; } commandsToRemove = Array . isArray ( commandsToRemove ) ? commandsToRemove : [ commandsToRemove ] ; commandsList = commandsList . filter ( function ( command ) { for ( var i = 0 ; i < commandsToRemove . length ; i ++ ) { if ( commandsToRemove [ i ] === command . originalPhrase ) { return false ; } } return true ; } ) ; }
Remove existing commands. Called with a single phrase, array of phrases, or methodically. Pass no params to remove all commands.

### Examples:

var commands = {'hello': helloFunction, 'howdy': helloFunction, 'hi': helloFunction};

// Remove all existing commands
annyang.removeCommands();

// Add some commands
annyang.addCommands(commands);

// Don't respond to hello
annyang.removeCommands('hello');

// Don't respond to howdy or hi
annyang.removeCommands(['howdy', 'hi']);

@param {String|Array|Undefined} [commandsToRemove] - Commands to remove
@method removeCommands
Remove existing commands . Called with a single phrase array of phrases or methodically . Pass no params to remove all commands .