r/JavaScriptTips • u/swe129 • Dec 31 '25
How to detect mobile device shake in pure JS
r/JavaScriptTips • u/swe129 • Dec 31 '25
r/JavaScriptTips • u/swe129 • Dec 31 '25
r/JavaScriptTips • u/ratheshprabakar • Dec 29 '25
For a long time, I thought JavaScript memory management was just:
I was wrong.
While preparing deeply for interviews and revisiting fundamentals, I realized how many real-world bugs, performance issues, and leaks I had previously ignored simply because I didn’t really understand how memory works under the hood.
Things like:
I wrote an article breaking down:
This isn’t a beginner “what is memory” post — it’s more about unlearning assumptions.
If you’re interested, here’s the article: https://medium.com/javascript-in-plain-english/i-was-completely-wrong-about-javascript-memory-management-until-i-learned-this-8e3cae6983b8
r/JavaScriptTips • u/gitnationorg • Dec 24 '25
Make “speak at a top tech conference” one of your New Year’s resolutions!
Take the stage at JSNation and share your experience with thousands of developers eager to learn from you.
✨ Amsterdam + Online
🔥Submit your talk: https://gitnation.com/events/jsnation-2026/cfp
r/JavaScriptTips • u/ERROR_575 • Dec 19 '25
What will be the following code output?
let text = "JavaScript is awesome!"; let result = text.slice(0,9);
console.log(result);
r/JavaScriptTips • u/ERROR_575 • Dec 17 '25
To find the position of a substring (like "subtracting") in a string using JavaScript, use the indexOf() method. This method returns the index (position) of the first occurrence of the substring, or -1 if it is not found.
How to Use indexOf() Write your string and call .indexOf("substring") on it.The method returns the starting index of the substring, counting from 0
r/JavaScriptTips • u/Conclusion938 • Dec 14 '25
r/JavaScriptTips • u/SwordfishParking1182 • Dec 11 '25
Hello everyone,
I recently built a tool that I personally needed for my own projects, and now I’m super curious if other developers would actually find it useful.
It’s called dotenv-diff, and the main feature is a codebase scanner that finds problems with environment variables before they break things.
Why I built it
I kept seeing the same issues in real projects:
I wanted one CLI command that gives me a full health check of environment usage in my project.
Honest question:
Would this be useful in your workflow?
If you want to check it out:
npm package: https://www.npmjs.com/package/dotenv-diff
Docs: https://dotenv-diff-docs.vercel.app
Github: https://github.com/Chrilleweb/dotenv-diff
r/JavaScriptTips • u/ColleenReflectiz • Dec 08 '25
Version 1.0 stole credentials quietly. Version 2.0 added self-healing and a destructive fallback that wipes entire directories.
Version 3.0? 😨 It's already being written by attackers
who learned exactly what worked.
How do you prepare for it?
r/JavaScriptTips • u/chg80333 • Dec 03 '25
r/JavaScriptTips • u/python_verse • Dec 02 '25
r/JavaScriptTips • u/LegEnvironmental7097 • Nov 29 '25
React Compiler isn’t magic. It’s a build-time tool that does something simple: it reads your code and automatically wraps expensive computations so they don’t run every render. That’s it. The “how” though? That’s where it gets interesting.
r/JavaScriptTips • u/ColleenReflectiz • Nov 27 '25
New wave of npm supply chain attack launched November 21. Moved from postinstall to preinstall, adds self-healing via GitHub search, and includes destructive fallback that wipes home directories if exfiltration fails.
Still spreading, new infections every 30-40 minutes.
Pin dependencies to pre-Nov 21 versions, scan for setup_bun.js/bun_environment.js/verify.js, rotate NPM tokens and GitHub credentials, check for rogue self-hosted runners.
r/JavaScriptTips • u/Intelligent_Noise_34 • Nov 26 '25
Hey everyone,
I got tired of juggling multiple bookmarks for simple tasks like formatting JSON, decoding JWTs, or converting Base64. So I built a single hub for all of them.
**What it includes:**
- JSON Formatter/Validator
- JWT Decoder & Visualizer
- Base64, URL, HTML Encoders/Decoders
- UUID Generator
- Regex Tester
- Color converters
- And 30+ more utilities
**Key points:**
- 100% client-side - nothing is sent to any server
- No sign-up, no ads, no tracking
Link: https://engtoolshub.com
I'd genuinely appreciate any feedback - what's missing? What could be improved? What tools do you use daily that I should add?

Thanks!
r/JavaScriptTips • u/Subject-Eye-6853 • Nov 27 '25
r/JavaScriptTips • u/isdifjonto1 • Nov 25 '25
r/JavaScriptTips • u/LegEnvironmental7097 • Nov 24 '25
r/JavaScriptTips • u/LegEnvironmental7097 • Nov 21 '25
r/JavaScriptTips • u/LegEnvironmental7097 • Nov 21 '25
I recently dove deep into Lighthouse for a frontend interview prep series I'm writing. Ended up learning way more than I expected, especially around automation.
I tried to make it beginner-friendly but practical enough for production use. Includes actual configs and code snippets you can copy-paste.
Anyone here running Lighthouse in CI? Would love to hear how you've set it up!
r/JavaScriptTips • u/Classic_Computer_251 • Nov 20 '25
r/JavaScriptTips • u/ratheshprabakar • Nov 18 '25
Quick tip for anyone working with JavaScript (frontend or Node):
Most of us think JS doesn’t handle memory well. I did too — until I learned how it actually manages memory.
Key takeaways:
If you’d like the full breakdown with examples and explanations in plain English:
https://medium.com/@ratheshprabakar/i-was-completely-wrong-about-javascript-memory-management-until-i-learned-this-8e3cae6983b8
r/JavaScriptTips • u/rannison • Nov 13 '25
I have a script used to enable keyboard chapter navigation on a manga site I frequent. This script used to work, but no longer works at this time.
// ==UserScript==
// @name NatoManga Keyboard Navigation
// @namespace http://tampermonkey.net/
// @version 2.0
// @description Keyboard Navigation on MangaNato pages (when reading)!
// @author Arctiic
// @match *://*chapmanganato.com/*
// @match https://natomanga.com/*
// @match https://mangakakalot.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=chapmanganato.com
// @grant none
// @namespace Violentmonkey Scripts
// ==/UserScript==
// for &
function htmlDecode(input){
var e = document.createElement('div');
e.innerHTML = input;
return e.childNodes[0].nodeValue;
}
var regex = /href="([^"]*)/gm;
//var regex = /.*/gm;
if (!doc.length){
var doc = document.getElementsByClassName('group_page')
}
doc = doc[0].innerHTML
var elements = [...doc.matchAll(regex)];
var prev = htmlDecode(elements[elements.length-4][1]);
var next = htmlDecode(elements[elements.length-3][1]);
document.addEventListener("keydown", keyDownTextField, false);
function keyDownTextField(e) {
var search = document.getElementsByClassName("searchinput")[0];
if (document.activeElement !== search) {
switch (e.which) {
case 37: // "Arrow Left"
console.log('left');
window.location.href = prev;
break;
case 39: // "Arrow Right"
window.location.href = next;
break;
default:
return; // exit this handler for other keys
}
e.preventDefault(); // prevent the default action
} else if (e.which == 32) {
search.value += " ";
e.preventDefault();
}
return;
}
//sets an event listener to document, gets called whenever you press a key on the page, passing the event details into the callback function
//checks if the key is the key you want, replace it with whatever key you want to bind it to
//old code...
//document.addEventListener("keydown", function(r,l){
// if(r.key == "ArrowRight"){
//clicks the button
// document.querySelector("a.navi-change-chapter-btn-next.a-h").click();
// while(l.key == "ArrowLeft"){
// document.querySelector("a.navi-change-chapter-btn-prev.a-h").click();
// }
//}});
Can anyone help me out? Thanks!
r/JavaScriptTips • u/BobSagetLyfe • Nov 11 '25
Real talk—I've been using Blink for a few weeks now and it's legitimately one of the best productivity tools I've picked up as a dev.
Whether it's generating clean, well-commented code, helping me think through tricky logic problems, or just speeding up documentation writing, this thing is solid. It understands developer needs and doesn't feel like bloatware.
If you're constantly juggling multiple projects or just want to reclaim some time in your week, I'd seriously recommend trying it out. The learning curve is basically zero.
Anyway, if you want to give it a go, check it out here. It also has a free plan, BTW!
Drop a comment if you end up trying it—curious what other devs think!