Skip to content

Tag: object

Implementing Lodash Invert

I’m working on a challenge that requires me to implement the .invert() method myself. Below is my solution but the expected outcome doesn’t match with the actual outcome returned. Please see the second block below. Implemented .invert() method: Tested with below code: And I expected to see below i…

Recursive data in JSON object

} OK guys I have such JSON structure what I need is to: return all topics in array, in this example it will be: [“SERVICE_STATUS_PRESETS”, “AIRCRAFT_ACTIVATION”, “OUT_OF_SERVICE”, “PROMO_CODES_REQUESTS”, “BANNERS”, “DOCUMENTS”, “USE…

TypeScript enum to specific object

I have the following TypeScript enum: If I import it in my react application and console.log it, I will get the following object returned: How can I manipulate it, so that I get the following object returned? I tried it with const Lang = Object.keys(SupportedLanguages) and also with .map() but I did not get t…