Answers for "&& || short operator"

3

&& || short operator

let tiktoker = "faisu"

// && opeator 
if(tiktoker == "faisu")
{
  console.log("6")
}

// Instead use && 
tiktoker=="faisu" && console.log(6)

// || opeator
if(tiktoker != "ccc")
{
  console.log("clean")
}

// Instead use ||
tiktoker =="xx" || console.log("clean")
Posted by: Guest on August-17-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language