Answers for "&& operator"


&& operator

let tiktoker = "faisu"

// && opeator 
if(tiktoker == "faisu")

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

// || opeator
if(tiktoker != "ccc")

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

->* 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