September 21st, 2024
What's missing in this code?
func('coding beauty', 'cofing beauti'); // ['d', 'y']
func('coffee shop', 'caffee shlp'); // ['o']
func('abcduf', 'ghijul'); // ['a', 'b', 'c', 'd', 'f']
function func(correct, typed) {
return [...correct]
.map((char, index) =>
char !==
? char : null
)
.
(
(char, index, self) =>
char &&
=== index
);
}
Type or select from these options