We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
functiongetLetter(s){letletter;// Write your code hereconsti=0;switch(true){casenewSet(["a","e","i","o","u"]).has(s.charAt(i)):letter="A";break;casenewSet(["b","c","d","f","g"]).has(s.charAt(i)):letter="B";break;casenewSet(["h","j","k","l","m"]).has(s.charAt(i)):letter="C";break;default:letter="D";}returnletter;}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Day 2: Conditional Statements: Switch
You are viewing a single comment's thread. Return to all comments →