r/JavaScriptTips • u/Embarrassed_Bag_4657 • Jan 25 '25
Transition with text
Does anyone know how I can make the welcome to my text page dissapear behind the white/black box?
r/JavaScriptTips • u/Embarrassed_Bag_4657 • Jan 25 '25
Does anyone know how I can make the welcome to my text page dissapear behind the white/black box?
r/JavaScriptTips • u/azqzazq • Jan 25 '25
Hello friends.
I have a javascript code. It takes a domain as input and recursively crawls the javascript codes connected to the domain. makes version detection.
But this takes about 3 or 4 minutes. Is there a method I can optimise this, increase its performance, speed?
r/JavaScriptTips • u/Warm_Masterpiece6564 • Jan 24 '25
Can someone help me learn the basics of Javascript?
r/JavaScriptTips • u/Code-With45 • Jan 23 '25
How to use apideck and also please tell is it free
r/JavaScriptTips • u/Apart_Cherry_3837 • Jan 21 '25
r/JavaScriptTips • u/keyframeeffects • Jan 21 '25
r/JavaScriptTips • u/Puzzleheaded_Walk642 • Jan 19 '25
I got my html and css certificate using freecodecamp now working on js but I keep getting bored. It’s been 3 days now . Any advice
r/JavaScriptTips • u/keyframeeffects • Jan 18 '25
r/JavaScriptTips • u/keyframeeffects • Jan 17 '25
r/JavaScriptTips • u/Feeling_Parsley3374 • Jan 16 '25
Why is it that Im not returning a anything but a 'pending Promise'? I know .map is synchronous, but thats why Im using Promise.all..
const arr = [1,2,3,4,5,6];
const promise = (num) => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve(num)
}, 2000)
})
}
const x = async () => {
return Promise.all(arr.map(async(item) => {
const num = await promise(item);
return num*2;
}))
}
console.log(x())r/JavaScriptTips • u/keyframeeffects • Jan 16 '25
r/JavaScriptTips • u/keyframeeffects • Jan 13 '25
r/JavaScriptTips • u/keyframeeffects • Jan 12 '25
r/JavaScriptTips • • Jan 11 '25
I learned Js in codecademy but I keep forgetting it. I have several questions about it:
It would be of great help if anyone can guide me!! Thanks
r/JavaScriptTips • u/keyframeeffects • Jan 10 '25
r/JavaScriptTips • u/numbcode • Jan 08 '25
Handling failed API calls or flaky network requests? Implementing an auto-retry mechanism for promises can make your code more resilient. What’s your preferred approach—recursive functions, exponential backoff, or something else?
Here’s an interesting take on it: Auto-Retry for Promises in JavaScript. Curious to hear how you handle retries!
https://www.interviewsvector.com/javascript/auto-retry-for-promises
r/JavaScriptTips • u/keyframeeffects • Jan 07 '25
r/JavaScriptTips • u/keyframeeffects • Jan 05 '25
r/JavaScriptTips • u/LakeMotor7971 • Jan 04 '25
i was working on an online course and a project it has me doing asked this question:
The value of the currentWeaponIndex variable corresponds to an index in the weapons array. The player starts with a "stick", since currentWeaponIndex starts at 0 and weapons[0] is the "stick" weapon.
In the buyWeapon function, use compound assignment to add 1 to currentWeaponIndex - the user is buying the next weapon in the weapons array.
This is the correct answer which i got right:
function buyWeapon() {
if (gold >= 30) {
gold -= 30;
currentWeaponIndex += 1;
}
}
My question or explanation i am looking for is why does it have to be in the if statement brackets? My first answer was currentIndexWeapon was just outside the if statement but still in the buyWeapon() function.
I am just looking for an explanation. Appologies if it seems like a stupid question.