Answers for "&& operator"

3

&& 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
-1

->* operator

//we have a class
struct X
{
   void f() {}
   void g() {}
};

typedef void (X::*pointer)();
//ok, let's take a pointer and assign f to it.
pointer somePointer = &X::f;
//now I want to call somePointer. But for that, I need an object
X x;
//now I call the member function on x like this
(x.*somePointer)(); //will call x.f()
//now, suppose x is not an object but a pointer to object
X* px = new X;
//I want to call the memfun pointer on px. I use ->*
(px ->* somePointer)(); //will call px->f();
Posted by: Guest on May-30-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language