Skip to content

Category: Questions

Dynamic import is not working the same as regular import

I have this file in ../../src/routes/index.js: I am trying to import this file via node because I want to create my own simple routing API class. Here is the code I’m trying to get working: This works: This does not work: I need the 2nd example to work because I want to dynamically import a bunch of fil…

How to sum of table amount in javascript? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about programming within the scope defined in the help center. Closed 4 months ago. Improve this question I have a table where I’m giving few amounts now I want to to…

Bcrypt.compare always returns true

I am using NestJS and Passport to create a simple log in/registration form and I am using bcrypt to see if the password that has been hashed is matching the password that user provides in the login form, but it always returns true In the code above, even if I set the argument as a string it will return true

Having trouble displaying object property

I’m building a small pokedex using PokeAPI. I’m retrieving data from an endpoint and building my own object. The function that I’ve built for the latter runs on page load as follows: I’m able to console log the object and traverse it in devtools, and also able to JSON stringify it and …

Condition with counter in timer

So I have been trying to make like a timer type thing to count from 0 to 5 (one number up every sec, like normal timer) then stopping at 5 but It’s not stopping at 5. What did I do wrong? Answer What you need to be doing is complete your conditional like:-

Regex (JS) : character appears no more than N times

I have the following string : In this string, I would like to replace the 0s that appear less than 6 times one after the other. If they appear 6 times or more, I would like to keep them. (Replace them with a dot for instance) The end result should then be I thought about using the negative lookahead and