Skip to content
Advertisement

Tag: node.js

nodejs import dynamic variable from another file

by using module.exports = var; and const var = require(“./file.js”); we can access a variable from another file but the imported variable is static and cannot change even if the original variable changes in the original file, how can I export an array that can be updated at any time and accessible in real time in another file? Answer put

How to create Polls on LinkedIn

I was able to successfully create regular Text, Image and Video Shares on LinkedIn using the Shares API. Now, I also need to create Polls on LinkedIn and I’ve searched so much around but can’t seem to find any documentations on how to do that using the Shares API. Does LinkedIn support creating Polls programmatically? If yes, can anyone suggest

how to auto generate id like AB22020001 in nodejs

i want auto generate id like “DC” + yaer + mounth + 4 digit in nodejs. I am using node js to create an api to connect to the database which I use phpmyadmin I want to create an id like AB22020001 But now all I can do is create an ID like AB2202. I don’t know how to make

Get specific elements of a Map in javascript

For a given map like this: How can I get the list of “phone”s? Something like: expected answer: [“213-555-1234”, “617-555-4321”] Answer You can directly iterate the Map object using its built-in iterator that works with a for loop. This has the advantage that it doesn’t make unnecessary intermediate arrays or copies of the data. As such, it should be more

Pause a for loop until function is completed

I’ve been scratching my brain at this a majority of the day, I am attempting to download multiple files that have iterating ID’s, I use a for loop to iterate and call a web request that calls a function that downloads a file. However, I noticed files tend to get corrupted due to multiple files being requested at once, I

Function recursion advice

I am building an employee tracking app. I want my app to work so that after each one of the functions for the various list selections is complete, the app will re-prompt you with the options list again. There are a few methods I can think of to achieve this but I was hoping a more seasoned developer could recommend

Advertisement