The question required me to get the first char from the first word in array with the last char from the second word in an array I can just get the first char but my problem is with the second one like:
var array1 = ["hello", "sam", "aola"];
var result = [];
const nextString =array1[1][array1[1].length - 1];
array1.map(function(currentString){
result.push(currentString.charAt(0)+nextString)
});
console.log(result);
here is my code give me this result: [ 'hm', 'sm', 'am' ]
but it expect to get this result :[ 'hm', 'sa', 'ao' ]
So please can anyone help me?