JSFiddle - React, Tailwind, and code Playground

by Edward Tanguay

HTML

<div id="content"></div>

JavaScript

let html = "";
const scores = [34, 65, 23, 54];
// NOTE: break not allowed with scores.forEach(function (score) 
for(score of scores) {
	if(score == 34) {
  	html = "Yes, 34 was found.";
    break;
  } 
}
html = html === "" ? "34 was not found." : html;

document.getElementById('content').innerHTML = html;