Sign in
Log inSign up

Return NaN

Default profile photo
Anonymous
·Oct 11, 2019

am trying to opt out a number but it telling me NaN

let number = document.getElementsByClassName("number");
for(var i=0;i<number.length;i++){
    number[i].addEventListener("click", function(){
        //this will display the number clicked
        let output =  reverseNumberFormat(getOutput());
        if(output!=NaN){ //if output is a number
            output=output+this.id;
            printOutput("num");
        }



    });
}
Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct