How to return the array variables values to another function on javascript?

function getPassedUsers() {
  var rr = ['a', 'b'];
  var xx = ['c'];
  return { rr, xx };
}

function ABC() {
  // i want to show letter 'b'
  console.log(rr[1]);
};
<input type="button" onClick="ABC()">

How to show the letter ‘b’ when I click the button ?

35 thoughts on “How to return the array variables values to another function on javascript?”

Leave a Comment