Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Javascript
Posted by: Chris Beardsley
Added: Aug 27, 2018 2:24 PM
Views: 8
Tags: no tags
  1. let userName = '';
  2. let knowsJavaScript = null;
  3.  
  4. if (knowsJavaScript && userName) {
  5.   console.log('Great, ' + userName + '! Get ready to practice your JavaScript!');
  6. } else if (knowsJavaScript) {
  7.   console.log('Great! Get ready to practice your JavaScript!');
  8. } else if (userName) {
  9.   console.log('Great, ' + userName + '! Get ready to learn something new!');
  10. } else {
  11.   console.log('Great! Get ready to learn something new!');
  12. }