//Opción 1: function areYouPlayingBanjo(name) { return name + (name[0].toLowerCase() == 'r' ? ' plays' : ' does not play') + " banjo"; } //Opción 2: function areYouPlayingBanjo(name) { const letra = name.charAt(0); if (letra === "r" || letra === "R") { return name + " toca el banjo"; } return name + " no toca el banjo"; }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter