You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
let f = s => {
switch s {
| "\\" => "backslash"
| "\"" => "doublequote"
| _ => "other"
}
}
let s1 = "\\"
let s2 = "\""
actual output (by the latest playground as of today)
function f(s) {
switch (s) {
case "\\\"" :
return "doublequote";
case "\\\\" :
return "backslash";
default:
return "other";
}
}
var s1 = "\\";
var s2 = "\"";
I expect the two cases to be case "\"" and case "\\" instead. Not that escape sequences that are used outside the switch-case context are translated appropriately.