Write a JavaScript program to create a new string with the results of calling a provided function on every character in the calling string
- برمجة جافاسكربت java script
- برمجة
- 2021-06-03
- ahmadghneem
الأجوبة
const mapString = (str, fn) =>
str
.split('')
.map((c, i) => fn(c, i, str))
.join('');
console.log(mapString('Javascript exercises', c => c.toUpperCase()));
أسئلة مشابهة
القوائم الدراسية التي ينتمي لها السؤال