Sha256: 346b43266b8baac78f3e44b5400faeac09eb0772bc72e00ae2d6c27a94d4da09
Contents?: true
Size: 507 Bytes
Versions: 211
Compression:
Stored size: 507 Bytes
Contents
let isSilence = (message) => message.replace(/\s+/g, '') === ''; let isShouting = (message) => message.toUpperCase() === message && /[A-Z]/.test(message); let isAQuestion = (message) => message[message.length - 1] === '?'; class Bob { hey(message) { if (isSilence(message)) { return 'Fine. Be that way!'; } else if (isShouting(message)) { return 'Whoa, chill out!'; } else if (isAQuestion(message)) { return 'Sure.'; } return 'Whatever.'; } } export default Bob;
Version data entries
211 entries across 211 versions & 1 rubygems