Is today Tuesday

THE CHALLENGE

Using the ternary operator create a condition who checks if today is Tuesday.

Please notice that I use print in the code instead of console.log to show the result in my built-in console below. However, you should use console.log to show the result in your normal console

THE CODE

        
          // WEEK 5 → DAY 2
          // Using the ternary operator create a condition who checks if today is Tuesday
                    
          function todayIsTuesday() {
          
            let today = new Date();
            let day = today.getDay();
          
            return (day === 2 ? "Yes; today is Tuesday" : "No; today is not Tuesday");
          
          };
          
          print(todayIsTuesday());
        
      

THE EXECUTION RESULT

        
      

the built-in console was provided by my amazing trainer Sorin. PrismJS plug-in is used to show the code