let x = {};x[/abc/] = 1;x[function() { return 1 }] = 2; let f = function() { return 1 };console.log(x[f]); // 2 let r = /abc/;console.log(x[r]); // 1
Standard input is empty
2 1
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!