Basic JavaScript - Logical Order in If Else Statements

showing me error - document is not defined

I am totally nervous please help me

function myF(num){
if(num>2) {
document.write(“greater than 2”);
else if(num<2){
document.write(“less than 2”);


Hello and welcome to the forum!
Please provide the link to the challenge.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.