the declaration of the resultla declaración de la variable must be out of the loopde result debe estar fuera del ciclo
'use strict'
var array = [];
var words = ["JHON", "CHARLES","KERLYN","YEAH","JUAN"]
var result = [];
words.forEach((element,index)=>{
if(element.lastIndexOf("J")==0){
result.push(element);
}
console.log(result)
})