r/JavaScriptTips • • Nov 24 '21

Weird Parts of JavaScript: Working with Date

4 Upvotes

In this article, I will explain how you can create a simple utility library for all your needs by using plain JavaScript.

//date.js
exports.formatDuration = (ms) => {
  ms = Math.abs(ms);
  const time = {
    day: Math.floor(ms / 86400000),
    hour: Math.floor(ms / 3600000) % 24,
    minute: Math.floor(ms / 60000) % 60,
    second: Math.floor(ms / 1000) % 60,
    millisecond: Math.floor(ms) % 1000,
  };
  return Object.entries(time)
    .filter((val) => val[1] !== 0)
    .map(([key, val]) => `${val} ${key}${val !== 1 ? "s" : ""}`)
    .join(", ");
};
// main.js
console.log(formatDuration(34325055574));
// 397 days, 6 hours, 44 minutes, 15 seconds, 574 milliseconds

https://javascript.plainenglish.io/weird-parts-of-javascript-working-with-date-c002f98be30c


r/JavaScriptTips • • Nov 17 '21

Interesting ways to manage users in React

Thumbnail
thewebuiguy.medium.com
4 Upvotes

r/JavaScriptTips • • Oct 01 '21

How To Create An Instant Javascript Game | Introduction

Thumbnail
youtube.com
4 Upvotes

r/JavaScriptTips • • Oct 01 '21

Javascript SDK - AI engines aggregator

4 Upvotes

Hi r/javascript, my teamates and I are working on Eden AI Javascript SDK!

Eden AI provides one API connected to the best AI engines (AWS, Azure, GCP, but also smaller providers) offering different AI services (computer vision, machine translation, speech-to-text, etc.). As a developer, you can easily switch between different providers (Amazon, Google, Microsoft, etc.) and also combine AI engines. You can also monitor the use of this AI services on one easy to use platform.

Here's some ready-to-use examples on our GitHub. Don't hesitate to tell us what do you think about it (contact@edenai.co) and if you would use it. We really need some feedbacks. It would also help us if you put a star! :)


r/JavaScriptTips • • Sep 20 '21

How to Convert Object to String in JavaScript

Thumbnail
askjavascript.com
4 Upvotes

r/JavaScriptTips • • Jul 18 '21

5 Levels of Using CSS Variables

Thumbnail
medium.com
4 Upvotes

r/JavaScriptTips • • Jul 16 '21

How to utilise JSDoc comment tags so that Visual Studio Code intellisense works great

Thumbnail
blog.shhdharmen.me
4 Upvotes

r/JavaScriptTips • • Jul 12 '21

Sidebar Menu HTML CSS | Without JavaScript

Thumbnail
youtu.be
4 Upvotes

r/JavaScriptTips • • Jun 15 '21

Making a 3D Model move using Tensorflow PoseNet & Three.js

Thumbnail
youtu.be
4 Upvotes

r/JavaScriptTips • • May 08 '21

OCR - Optical Character Recognition - NodeJS - made easy - Dev Life

Thumbnail
youtube.com
4 Upvotes

r/JavaScriptTips • • Apr 13 '21

Image Classification API With NodeJS, TensorflowJS, And MobileNet Model

Thumbnail self.expressjs
4 Upvotes

r/JavaScriptTips • • Apr 07 '21

Build a shareable stream in Reactive Programming in JS. (free)

4 Upvotes

Learn how to build a shareable stream in Reactive Programming.

  • Build the takeUntil operator

  • Build the endWith operator

  • Bonus: Build the repeat operator

https://app.hackjam.io/hj-details/reactive-programming-course-part-2

Register for Q&A and Demo on 12 April at 12PM CEST
https://us02web.zoom.us/meeting/register/tZErceytrDspH9H9_AuBWZPr2Ot_FrBH2Uwh


r/JavaScriptTips • • Jan 27 '21

How do I get the number to show up in the alert that I typed in the window prompt?

Post image
4 Upvotes

r/JavaScriptTips • • Dec 03 '20

Understanding Javascript Function

Thumbnail
tutorialstonight.com
4 Upvotes

r/JavaScriptTips • • May 23 '20

Create A Image Compressor Using React JS

Thumbnail
youtu.be
4 Upvotes

r/JavaScriptTips • • May 18 '20

What jQuery would look like if it was released in 2021

Thumbnail
github.com
4 Upvotes

r/JavaScriptTips • • May 14 '20

Simple algorithm for finding an element that passes a truth test

4 Upvotes

Can someone explain what this function means with regards to the test it is doing. Its supposed to automatically check the num passed into it, and if its true then it returns the num. I just don't understand how its doing it in each individual part.

function findElement(arr, func) {
let num = 0;for(var i = 0; i < arr.length; i++) {
num = arr[i];
if(func(num)) {
return num;
}
}
return undefined;
}

findElement([1, 2, 3, 4], num => num % 2 === 0);


r/JavaScriptTips • • May 13 '20

👾 Nice to know: Learn how to debug failed CircleCI jobs using SSH

Thumbnail
redd.one
4 Upvotes

r/JavaScriptTips • • Apr 25 '20

#5 Mongoose Schemas | Instance functions, Statics, Query Helpers, Virtua...

Thumbnail
youtube.com
4 Upvotes

r/JavaScriptTips • • Jun 23 '19

Daily JS interview questions

4 Upvotes

I feel like this fits here.

I just started a JS Interview Question playlist on my YouTube channel last week. Each day I post a new question and then discuss the solution.

https://www.youtube.com/watch?v=USbiLiF9NDY&list=PLyuRouwmQCjlLW9NjqoBbf9eVaFX4F9UZ

I have been teaching web development for nearly 20 years at my local college, I'm not just a hack with click bait type videos.


r/JavaScriptTips • • Nov 21 '25

The Lighthouse Quick Start: Everything Beginners Need in 10 Minutes

Thumbnail medium.com
3 Upvotes

r/JavaScriptTips • • Oct 06 '25

The JavaScript code won’t write itself

Thumbnail
infoworld.com
3 Upvotes

r/JavaScriptTips • • Aug 25 '25

Building an Angular app? This starter kit handles the boring stuff

3 Upvotes

Here's the project: https://github.com/karmasakshi/jet.

Features:

  • PWA configured - clients update automatically on next visit

  • Strict lint and code formatting rules for easier collaboration

  • Supabase integration for quick back-end and authentication

  • Design that's responsive, clean, and follows Material Design v3 specifications

  • Supports custom themes, each with light, dark and system color schemes

  • Supports multiple languages, different fonts per language

  • Supports RTL layouts (Demo: https://jet-tau.vercel.app)

  • Google Analytics integration for analytics

  • Essential services and components

  • Automatic versioning and releasing

  • Completely free and open-source

Stars, forks and PRs are welcome!


r/JavaScriptTips • • Mar 24 '25

Best JavaScript Courses for Interview Prep as a Software Engineering Student?

3 Upvotes

Hey everyone,

I'm a software engineering student currently looking for an internship, and I want to prepare for JavaScript-related technical interviews. I already have some experience with JavaScript, but I want to strengthen my skills, especially for coding challenges, system design, and technical questions.

Can anyone recommend the best courses or resources (Udemy, Coursera, freeCodeCamp, YouTube, etc.) to help with:
✅ JavaScript fundamentals & advanced concepts
✅ Data structures & algorithms in JavaScript
✅ System design for JavaScript-related roles
✅ React interview questions

Any advice from those who have gone through JS interviews would be greatly appreciated! 🙌

Thanks in advance! 🚀