Q:

Write a JavaScript program to get an array of elements that appear in both arrays

0

Write a JavaScript program to get an array of elements that appear in both arrays.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

const sortCharactersInString = str => [...str].sort((a, b) => a.localeCompare(b)).join('');

console.log(sortCharactersInString('cabbage'));

console.log(sortCharactersInString('a7fs23l1n4o6x'));

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now