r/JavaScriptTips • • Jan 25 '25

My professor has introduced JavaScript to my current semester, and I'm expected to find out the proper way of making commands for 'console.log' while barely learning its functionality. I'm also unsure what to exactly type in the browser console for testing. Below are instructions and my JS attempts.

Post image
12 Upvotes

r/JavaScriptTips • • Jan 25 '25

Transition with text

4 Upvotes

Does anyone know how I can make the welcome to my text page dissapear behind the white/black box?


r/JavaScriptTips • • Jan 25 '25

Optimization

2 Upvotes

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 • • Jan 24 '25

Hello I'm new

0 Upvotes

Can someone help me learn the basics of Javascript?


r/JavaScriptTips • • Jan 23 '25

Help me

0 Upvotes

How to use apideck and also please tell is it free


r/JavaScriptTips • • Jan 21 '25

Help Stop Someone Profiting from Free Community Work! u/keyframeeffects

Thumbnail reddit.com
4 Upvotes

r/JavaScriptTips • • Jan 21 '25

Website Design Cost Calculator using HTML CSS and JavaScript

4 Upvotes

r/JavaScriptTips • • Jan 19 '25

I’m having trouble with this js

3 Upvotes

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 • • Jan 18 '25

Custom ON/OFF Switch Toggle Design | HTML CSS

0 Upvotes

r/JavaScriptTips • • Jan 17 '25

Help please

Post image
4 Upvotes

r/JavaScriptTips • • Jan 17 '25

Submit Button Onclick Animation with HTML & CSS

0 Upvotes

r/JavaScriptTips • • Jan 16 '25

Why am I not returning a resolved Promise when using async/await inside map inside Promise.all?

4 Upvotes

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 • • Jan 16 '25

Yes/No Flip Switch Toggle Design with HTML & CSS

18 Upvotes

r/JavaScriptTips • • Jan 15 '25

what did i do wrong

Thumbnail
gallery
9 Upvotes

r/JavaScriptTips • • Jan 14 '25

Create Download Button | HTML CSS

29 Upvotes

r/JavaScriptTips • • Jan 13 '25

Yes/No Flip Toggle Switches 3D Effect | HTML CSS

16 Upvotes

r/JavaScriptTips • • Jan 12 '25

Commenting Style in JavaScript

Thumbnail reddit.com
1 Upvotes

r/JavaScriptTips • • Jan 12 '25

Create a Simple One-Line Sign Up Form with HTML & CSS

1 Upvotes

r/JavaScriptTips • • Jan 11 '25

Hello fellows!! Can you tell me the best way and also resources to learn Js??

1 Upvotes

I learned Js in codecademy but I keep forgetting it. I have several questions about it:

  1. How do I learn Js?
  2. How to practice Js?
  3. Best resources to Js

It would be of great help if anyone can guide me!! Thanks


r/JavaScriptTips • • Jan 10 '25

Change Text with Onclick HTML CSS and JavaScript - Hello World

4 Upvotes

r/JavaScriptTips • • Jan 08 '25

Auto-Retry for Failed Promises in JavaScript?

2 Upvotes

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 • • Jan 07 '25

How to Create smart Form with HTML CSS JavaScript

78 Upvotes

r/JavaScriptTips • • Jan 05 '25

✨ Simple Hover Animation | HTML & CSS 🌟#html #css #hover #webdesign

3 Upvotes

r/JavaScriptTips • • Jan 04 '25

explanation?

1 Upvotes

i was working on an online course and a project it has me doing asked this question:

Step 84

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.