Posts by Israel Lopes • 13 points
4 posts
-
-1
votes1
answer97
viewsQ: Turn function into String with Javascript
Assuming I have the following object below const teste = { onload: ()=> { console.log('a') } } Where the onload attribute is a function, and I need it to be transformed into a string so that I…
-
-1
votes2
answers218
viewsA: Generate a new array from another with reduce javascript
I got it this way. Sample array : [ { a: 1, b: 2 }, { a: 1, b: 5 }, { a: 1, b: 1 }, { a: 1, b: 1 }, { a: 11, b: 11 }, { a: 3, b: 4 }, { a: 3, b: 4 }, { a: 3, b: 4 }, { a: 3, b: 4 }, { a: 3, b: 4 },…
-
-1
votes2
answers218
viewsQ: Generate a new array from another with reduce javascript
I have the following array: const array = [ { a: 1, b: 2 }, { a: 1, b: 1 }, { a: 3, b: 4 } ]; I would like a second array to be generated for each time I repeat the attribute to, generates a new…
-
0
votes1
answer366
viewsQ: bcrypt.compare returning false even with correct password after certain period of time
I’m using the bcrypt to generate password hash in Node.js, as code below, after creating a user: UserSchema.pre("save", async function(next) { const hash = await bcrypt.hash(this.pass, 8); this.pass…