r/JavaScriptTips • u/thecoode • Nov 21 '24
r/JavaScriptTips • u/Nearby-woods-9285 • Nov 21 '24
help me with the JAVASCRIPT code
so i hv been trying to learn JS & practice in Vishual Studio Code....i am trying to run a simple JS program but in shows me syntax error in <!DOCTYPE html>...remember this pgm runs good on online compiler but not in vishual studio code..i have installed node js already
it displays the following
<!DOCTYPE html>
^
SyntaxError: Unexpected token '<'r/JavaScriptTips • u/OrganizationPure1716 • May 25 '25
WHAT ARE THE CURRENT TECHNOLOGIES WE SEE IN JS ANIMATION PORTFOLIOS, WEBSITES , Give the opinions
What are the current technologies used in current fully animated websites, is it react ___ … etc ?
r/JavaScriptTips • u/[deleted] • Aug 05 '25
Hello, I have a problem with an animation
Here is my code, the goal is simple, display an element with a small opacity magnet, and make sure that when it is not displayed it does not take up space, but here it does not work, thank you for your precious helpHere is my code, the goal is simple, display an element with a small opacity magnet, and make sure that when it is not displayed it does not take up space, but here it does not work, thank you for your precious help :
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Apparition avec fondu</title>
<style> \#box { opacity: 0; display: none; transition: 1s; background: lightblue; padding: 1em; margin-top: 1em; } </style>
</head>
<body>
<button id="btn">Afficher</button>
<div id="box">Je suis animé en fondu</div>
<script> const btn = document.getElementById('btn'); const box = document.getElementById('box'); btn.addEventListener('click', () => { // Étape 1 : afficher (affiche d'un coup, mais invisible car opacity 0) box.style.display = 'block'; // Étape 2 : attendre une frame, puis lancer l'opacité requestAnimationFrame(() => { box.style.opacity = '1'; }); }); </script>
</body>
</html>
r/JavaScriptTips • u/GitNation • Sep 23 '26
📣 React Summit Asia 2027: Call for Presentations is open!
Share your talk or workshop with hundreds of developers on Full-Stack Architecture, AI-Assisted Coding & AI Engineering, Growing to Senior/Tech Lead, etc.
📍 April 15 & 19, Singapore
Submit by Jan 12: https://gitnation.com/events/react-summit-asia/cfp
r/JavaScriptTips • u/GessielSP • Apr 18 '24
[AskJS] What happened with the "time spent in each line" when using the Performance Tab on Chrome/Edge? Is there any plugin replacement or any configuration?
r/JavaScriptTips • u/xplodivity • May 14 '23
10 JavaScript One Liners to save 1000+ hours
r/JavaScriptTips • u/summonthejson • Aug 17 '24
Should I learn Javascript from MDN or W3Schools?
r/JavaScriptTips • u/daidaicodes • Jun 14 '23
Quiz 💡 What will be the output of the following code snippet and why?
A. true B. false
r/JavaScriptTips • u/Parking_Cap2351 • Oct 09 '25
“Promise.all vs allSettled vs race vs any” — Which one do you actually use in real projects?
I’ve seen this question (and mistake) pop up so many times:
A dev wraps multiple API calls inside Promise.all… one fails… 💥 and suddenly everything crashes.
The truth?
Not all Promise methods behave the same — and understanding their differences can save you hours of debugging and weird async bugs.
Here’s the quick rundown I shared in my latest deep-dive article 👇
Promise.all→ All or nothing. If one fails, everyone fails.Promise.allSettled→ Waits for all, even if some fail. Perfect for logging or partial UI updates.Promise.race→ First to settle (success or failure) wins. Great for timeouts.Promise.any→ First success wins. Perfect for redundant or fallback API calls.
What I found fascinating while writing it is how differently they behave in the event loop — and how easily we misuse them without realizing.
I even added analogies (like race cars 🏎️, delivery partners 🚚, and job offers 💼) to make each concept click instantly.
If you’ve ever asked yourself “Which Promise should I use here?”, this breakdown might be worth a read.
(And yeah — it’s written for everyone from juniors to seasoned devs.)
👉 Promise.all vs allSettled vs race vs any — What Every JavaScript Developer Should Know
Curious to know:
Which one do you use most in your day-to-day code — and have you ever had a bug caused by the wrong choice?
r/JavaScriptTips • u/[deleted] • Apr 11 '23
95%+ of the content on this sub is better explained here
r/JavaScriptTips • u/yangzhou1993 • Jul 11 '21
4 Ways To Write For Loops in JavaScript
r/JavaScriptTips • u/keyframeeffects • Dec 22 '24
Interactive Submit Button Using HTML CSS and JavaScript
r/JavaScriptTips • u/bear007 • Mar 20 '24
Have you seen Javascript cards? 65 cards that help you learn the most popular programming language.
r/JavaScriptTips • u/No-Upstairs-2813 • Sep 22 '24
How to Use ChatGPT for Learning JavaScript
In a post on r/learnjavascript, someone asked how to use ChatGPT to learn JavaScript. I decided to explain my approach through an infographic.

You can read the entire article here.
Note: ChatGPT can occasionally give flawed explanations or code. Always double-check the information with trusted sources like official documentation.
r/JavaScriptTips • u/Prize_Attitude1485 • Jul 14 '25
Why learning React is no easy task?
reddit.comr/JavaScriptTips • u/devMai • Feb 17 '26
How to Fetch Data in JavaScript (The Clean Way)
r/JavaScriptTips • u/Pretend-Ad-6453 • Mar 20 '25
Help with getting my code to work right.
Trying to get this “app” (made in code.org unfortunately, it’s for school) to work right but it keeps popping out really small numbers I know can’t be accurate as the final price, even if using the weekly number which would multiply it, making it supposedly larger.
r/JavaScriptTips • u/GitNation • Jan 24 '25
Call for Presentations - Node Congress, April 17-18, 2025
r/JavaScriptTips • u/ERROR_575 • Dec 19 '25
Extract a Substring from a String
What will be the following code output?
let text = "JavaScript is awesome!"; let result = text.slice(0,9);
console.log(result);
r/JavaScriptTips • u/thecoode • Nov 14 '24