Ad

Write a function that returns "Hello World baby" if its true and "No World" if its false

Code
Diff
  • /*def hello_world(world):
        if world == True:
            return "Hello World baby"
        elif world == False:
            return "No World"*/
    
    // helloWorld = (world) => world == true ? 'Hello World baby': 'No World';
    
    const helloWorld=(world)=>world ?`Hello World baby`:`No World`;
    • /*def hello_world(world):
    • if world == True:
    • return "Hello World baby"
    • elif world == False:
    • return "No World"*/
    • // helloWorld = (world) => world == true ? 'Hello World baby': 'No World';
    • const helloWorld=(world)=>world==true?`Hello World baby`:`No World`;
    • const helloWorld=(world)=>world ?`Hello World baby`:`No World`;