rock-paper-scissors-combinations

// get all possible combinations for a game of rock paper scissors

var rps = function(pos) {
  var combinations = [];
  
  var i = 0;
  while (i < pos.length) {
    
    var ii = 0;
    while (ii < pos.length) {
      
      combinations.push(pos[i] + pos[ii]);

      ii++;
    }
    i++;
  }
  return combinations;
};

console.log(rps(['r', 'p', 's']));