Swapna Kumar Panda Profile picture
Feb 10, 2022 11 tweets 7 min read Read on X
25 Utility Code for your next JavaScript Project

➊ Check if input is of number type
➋ Check if input value contains a number
➌ Check if input value is null or, undefined
➍ Check if input value is null or, empty string
➎ Check if input value is falsy
➏ Check if input is an Array
➐ Check if input is an Empty object
➑ Convert first character of each sentence to uppercase
➒ Convert first character of each word to uppercase
➓ Reverse a string
➊➊ Convert a number from one base to another
➊➋ Create and initialise array
➊➌ Empty an array
➊➍ Remove falsy values from an array
➊➎ Remove duplicates from array
➊➏ Casting an array to array of numbers
➊➐ Return a series of integers starting from 0
➊➑ Flatten Array to any depth
➊➒ Remove Holes from Array
➋x➓ Merge any number of arrays
➋➊ Shuffle an array
➋➋ Generate a Random Boolean
➋➌ Generate a Random Number
➋➍ Generate a Random ID
➋➎ Generate a Random Hex Color Code
👉Suggestions👈

⬖ Do you have better implementation for any of these methods? Share those in 💬

⬗ If you find any incorrect information, do inform me.
🚏 Upcoming Twitter Space

📅 12-Feb-2022 (Saturday)
⏰ 07.30PM IST (02.00PM GMT)

⬘ Join me in this space to have some interesting technical discussion around "Arrays and Functions in JavaScript".

⬙ Share among your circle if anyone is interested.

twitter.com/i/spaces/1dRJZ…
End of 🧵

Do you find these utility code useful? I will be sharing more like these for HTML, CSS, JavaScript and React in coming days regularly.

To never miss any, Follow me ✅

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Swapna Kumar Panda

Swapna Kumar Panda Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @swapnakpanda

Jun 26
Learning AI & ML becomes SUPER EASY when you finish THESE COURSES:
1. CS221 - Artificial Intelligence

🖇 youtube.com/playlist?list=…Image
2. CS229 - Machine Learning

- By Andrew Ng

🖇 youtube.com/playlist?list=…Image
Read 8 tweets
Jun 21
As a SOFTWARE ENGINEER, do you hate Data Structures and Algorithms (DSA)?

I promise you will love it after going through this thread:
Many just hate DSA because they don't know where to start and how to proceed.

I am going to list down 175+ algorithms associated with most commonly used data structures.

Just practice them using any of your favourite language.

❯ C/C++
❯ Java
❯ Python
❯ JavaScript

BE ON TOP 5% of programmers.
➊ Arrays

➀ Creating an Array
➁ Iterate through Array
➂ Get an Element
➃ Search an Element
➄ Insert Element(s)
➅ Delete Element(s)
➆ Filter an Array
➇ Fetch a Sub-Array
➈ Merging Arrays
➉ Reverse Array
➀➀ Rotate Array
Read 20 tweets
Jun 4
AI & ML FREE Courses from Stanford:

❯ CS336 - LLM from Scratch
❯ CS221 - Artificial Intelligence
❯ CS229 - Machine Learning
❯ CS230 - Deep Learning
❯ CS234 - Reinforcement Learning
❯ CS224N - NLP with Deep Learning

All course links inside:Image
1. CS336 - Language Model from Scratch

- 2025

🖇 youtube.com/playlist?list=…Image
2. CS221 - Artificial Intelligence

🖇 youtube.com/playlist?list=…Image
Read 14 tweets
Jun 1
If you are SERIOUS about SYSTEM DESIGN,

WATCH ALL THESE VIDEOS:
1. System Design Basics

youtube.com/playlist?list=…Image
2. System Design Fundamentals

youtube.com/playlist?list=…Image
Read 17 tweets
May 12
You will be a world-class backend engineer once you finish watching all these courses:
1. Complete Backend Course

Image
2. Complete Git Course

Image
Read 14 tweets
May 7
Python is a MANDATORY SKILL in 2026.

This is how you can MASTER it in 1 year:
0. Preliminary Steps

Before deciding to start, ensure you do these

⬩Know your final goal
⬩Set a target for spending daily 1 hour minimum.
⬩Research about Python ecosystem (libraries, frameworks, code editors).

P.S: This is my personal roadmap. I could spend 1 to 2 hours daily for learning and practicing during 2020. And it took me ~1 year to finish logically. It may differ from person to person.
➊ Start with a bang: Simple Data Types

Schedule: 1st Month
Effort: 1 to 2 hours daily + Normal practice

❯ Boolean
⬩bool
❯ Number
⬩int
⬩float
⬩complex
❯ String
⬩str
❯ Bytes
⬩bytes
⬩bytearray
⬩memoryview
Read 16 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(