Skip to content
Advertisement

Tag: nodes

create custom nested output from json using javascript

I am trying to save data in json object by using map function but the problem is I can save data by using needed_key:value.arrayData.key needed_value:value.arrayData.value if all the needed_key and needed_value are same I can use above code but here problem is key name is same but the needed_value get change by random and value I only want to save

Compare date and time in array of objects

I’m trying to compare the date and time to manipulate my data. I need to check which is the latest data by checking updated_at key inside object. Below I have given the scenario. I’m trying like this, but how to use moment here to compare which is latest. But I’m not getting the expected result as below. How can I

How to find path from tree of nodes

Consider a data structure similar to the one below: The function I have tried is as follows using recursion. I am getting an output: [{name: ‘Link10’, url: ‘link10’}] I would like to get an output as follows: And if I call the function as follows: Should return results as [{name: ‘Link11’, url: ‘link11’,}] I tried the following as well and

resolve and reject issue using node js

Is this possible way to return resolve or reject message from one function to another? As I am writing to pass resolve message in postman whenever my task is completed or reject message when there is some error But after after writing return it still not returning the resolve message or reject message inside Postman any idea how this can

Cannot Uninstall two npm Packages

I have installed node-gyp in order to install scrypt. While installing the node-gyp package the following two packages were installed along with it: 101@1.6.3 d@1.0.1 I have tried to remove these two packages, realising that I did not need the node-gyp and scrypt packages, but sudo npm uninstall does not remove them. How can I uninstall these packages? Answer If

Advertisement