I would like to be able to call a function on a switch case statement but I can't seem to figure it out. Example:
switch(message.toLowerCase()) {
// the startsWith would be an extension of the message.toLowerCase()
// so that the case would be checking for message.toLowerCase().startsWith("pay")
case startsWith("pay"):
console.log(message)
break
}
I have tried using case.function(), function(case), and case function(), but none of them work. Thanks!