fork download
  1. Season = Object.freeze({
  2. Summer: 1,
  3. Fall: 2,
  4. Winter: 3,
  5. Spring: 4
  6. });
  7.  
  8. let summer = Season.Summer;
  9. let strValue = "";
  10. for (var i in Season) {
  11. if (Season[i] === summer) {
  12. strValue = i;
  13. break;
  14. }
  15. }
  16. //strValue is "Summer"
  17.  
  18. console.log(`strValue is "${strValue}"`);
Success #stdin #stdout 0.04s 18888KB
stdin
Standard input is empty
stdout
strValue is "Summer"