Morgan & Morgan Interview Question

How would you declare a function that receives one parameter name hello? If hello is true, then the function must print hello, but if the function doesn’t receive hello or hello is false the function must print bye.

Interview Answer

Anonymous

Oct 9, 2020

function func(hello) { if(!hello && hello == false) { var_dump(‘bye’); } return true; }