1👍
✅
use the optional chaining (?.) operator to check if the variable is not null before accessing it.
change :
data.forEach(el => {.....
to :
data?.forEach(el => {.....
and make sure to access div
correctly you have to :
change :
<div class="quiz-box"></div>
to :
<div id="quiz-box"></div>
Source:stackexchange.com