const sampleArray = [
469,
" " + 755,
" " + 244,
" " + 245,
" " + 758,
" " + 450,
" " + 302,
" " + 20,
" " + 712,
" " + 71,
" " + 456,
" " + 21,
" " + 398,
" " + 339,
" " + 882,
" " + 848,
" " + 179,
" " + 535,
" " + 940,
" " + 472,
];
let mainDiv10 = document.getElementById("main");
let myParagraph10 = document.createElement("p");
let myTextNode10 = document.createTextNode("KATA 11");
myParagraph10.append(myTextNode10);
mainDiv10.append(myParagraph10);
let max9 = 100;
let oneToTwentyFive10 = [];
function array2() {
if (sampleArray % 2 === 0) mainDiv10.append(sampleArray + " ");
}
array2();
My HTML is all corret but I know something is wrong with my javascript syntax. I got the array to console.log
and also appear on my HTML page but not the even numbers.