{"ScriptPreparationCode":"var ICON_TO_FACILITY_ID = {\r\n parking_sign: [2, 46, 160, 161, 162, 179, 180, 181],\r\n food_and_drink: [3, 6, 115, 116, 176, 177, 306, 409, 9103, 9114, 9115],\r\n pawprint: [4, 217, 218],\r\n clean: [5, 158],\r\n bar: [7, 199],\r\n frontdesk: [8, 78, 418],\r\n tennis: [9, 87, 215, 216],\r\n sauna: [10, 79],\r\n fitness: [11, 253, 255, 256],\r\n golf: [12, 97],\r\n newspapers: [13],\r\n garden: [14],\r\n resort: [15, 118, 222],\r\n nosmoking: [16, 108],\r\n shuttle: [17, 128, 139, 209, 210, 304, 430],\r\n fish: [19],\r\n briefcase: [20],\r\n baby_bottle: [21],\r\n washer: [22, 23, 429],\r\n coffee: [24, 43, 219, 305],\r\n disabled: [25, 184, 185, 186, 187, 188, 189],\r\n skiing: [26, 100, 130, 131, 132],\r\n salon: [27, 230, 233, 234, 235],\r\n family: [28],\r\n game: [29],\r\n playing_cards: [30],\r\n crown: [41],\r\n iron: [44],\r\n wifi: [47, 96, 107, 163, 164],\r\n elevator: [48],\r\n instantconf: [49],\r\n solarium: [50],\r\n safe: [51],\r\n valet_parking: [52],\r\n change_currency: [53],\r\n spa: [54, 227, 228, 236, 237, 238, 239, 240, 242, 243, 244],\r\n massage: [55, 245, 246, 247, 248, 249, 250, 251, 252],\r\n billiard_ball: [57],\r\n music_note: [59, 126, 147, 410],\r\n shopping_bag: [60, 81, 92],\r\n windsurfing: [61],\r\n spring: [63, 138, 166, 167, 241],\r\n soundproof: [64],\r\n bike_fee: [65],\r\n book: [66, 171],\r\n sparkles: [67, 101],\r\n canoe: [69],\r\n hiking: [70, 404],\r\n cathedral: [71],\r\n bbq: [72],\r\n packed_lunch: [73, 224],\r\n car_side: [75],\r\n bike: [76, 123, 405, 426],\r\n bowling: [77],\r\n heater: [80],\r\n diving: [82, 90],\r\n horse: [86],\r\n taxi: [89],\r\n cabin_trolley: [91],\r\n luggage_storage: [99],\r\n pool: [\r\n 103,\r\n 104,\r\n 119,\r\n 120,\r\n 121,\r\n 122,\r\n 148,\r\n 169,\r\n 192,\r\n 193,\r\n 194,\r\n 195,\r\n 196,\r\n 197,\r\n 198,\r\n 200,\r\n 201,\r\n 223,\r\n 258,\r\n 301,\r\n 433\r\n ],\r\n snowflake: [109],\r\n smoking: [110],\r\n atm: [111],\r\n beach: [114, 146, 220, 221, 302, 9000],\r\n breakfast: [117, 9104, 9105, 9106, 9107, 9108, 9109, 9110, 9111, 9112, 9113],\r\n concierge: [124],\r\n sunglasses: [127, 168],\r\n shuttle_fee: [129, 140],\r\n page: [133],\r\n vending_machine: [135, 136],\r\n kitesurfing: [137],\r\n oven: [141],\r\n key: [142, 257, 419, 420],\r\n couch: [143],\r\n basket: [145],\r\n person: [149],\r\n shopping_cart: [159],\r\n screen: [175],\r\n flash: [182],\r\n bus_side: [183],\r\n wine: [203, 407],\r\n grapes: [205],\r\n waffle: [206],\r\n attractions: [207],\r\n visual_impairment: [211, 212],\r\n stroller: [214],\r\n campfire: [225],\r\n makeup: [226, 229, 231, 232],\r\n yoga: [254],\r\n paintbrush: [400],\r\n beer: [401],\r\n theater: [402],\r\n play: [403],\r\n geo_pin_heart: [408],\r\n megaphone: [421, 422],\r\n videochat: [423, 424],\r\n wind: [425],\r\n phone: [427],\r\n email: [428],\r\n bath: [431],\r\n checkin: [8001],\r\n checkout: [8002]\r\n};\r\n\r\nvar getFacilityIconById1 = facilityId =\u003E {\r\n for (var icon in ICON_TO_FACILITY_ID) {\r\n if (ICON_TO_FACILITY_ID[icon].indexOf(facilityId) !== -1) {\r\n return icon;\r\n }\r\n }\r\n return \u0027checkmark\u0027;\r\n};\r\n\r\nvar getFacilityIconById2 = (() =\u003E {\r\n var hash;\r\n return (facilityId) =\u003E {\r\n if (!hash) {\r\n hash = Object.entries(ICON_TO_FACILITY_ID).reduce((obj, item) =\u003E {\r\n item[1].forEach(id =\u003E obj[id] = item[0]);\r\n return obj;\r\n }, {});\r\n }\r\n return hash[facilityId] || \u0027checkmark\u0027;\r\n };\r\n})();","TestCases":[{"Name":"Without cashing the operation","Code":"for (var i = 0; i \u003C 10000; i\u002B\u002B) {\r\n getFacilityIconById1(i);\r\n}","IsDeferred":false},{"Name":"Cashing the operation","Code":"for (var i = 0; i \u003C 10000; i\u002B\u002B) {\r\n getFacilityIconById2(i);\r\n}","IsDeferred":false}]}