Simon Høiberg Profile picture
Aug 5, 2021 16 tweets 5 min read Read on X
JavaScript 💡

14 Array Methods that will land you the next job.
Learn and understand what they do and how to use them.

Explanation and examples below 🧵👇
🔸 map

The map() method creates a new array populated with the return value of the callback function for each element in the array.
🔸 forEach

The forEach() method executes a provided function once for each array element.
The callback function does not expect a return value, and the forEach() method itself also returns undefined.
🔸 filter

The filter() method creates a new array containing only the elements that "pass the test" implemented by the callback function.
We call this type of callback a predicate function.
🔸 find

The find() method behaves similarly to the filter() method, but it only returns a single element.
This method will stop at the first element that "pass the test", and return that.
If none exists, it will return undefined.
🔸 findIndex

The findIndex() method behaves similarly to the find() method, but it returns an index instead of the element,
This method will stop at the first element that "pass the test", and return its index.
If none exists, it will return -1.
🔸 reduce

The reduce() method takes a callback with (at least) two arguments:
An accumulator and the current element.

For each iteration, the return value of the callback function is passed on as the accumulator argument of the next iteration.
🔸 some

The some() method takes a predicate function and return true if any of the elements in the array "passes the test".
🔸 every

The every() method takes a predicate function and returns true if all of the elements in the array "pass the test".
🔸 includes

The includes() method checks if an array includes a certain value among its elements, returning true or false.
🔸 fill

The fill() method replaces all the elements in an array to a given value.
🔸 reverse

The reverse() method reverses the order of the elements in the array.
🔸 flat

The flat() method creates a new array with all sub-array elements flattened into it.
You can specify a depth. The default is 1.
🔸 flatMap

The flatMap() method applies a callback to each element of the array and then flatten the result into an array. It combines flat() and map() in one function.
🔸 sort

The sort() method is used to sort the elements of an array and returning the sorting array.
Be aware that this method is mutating the original array.
I recently published an e-book with 65+ code-snippets including explanations for JavaScript, React, NodeJS, and AWS Lambda.

Pick it up for ⚡ free ⚡ here on Gumroad 👇

🔗 simonhoiberg.gumroad.com/l/65-js-codesn…

• • •

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

Keep Current with Simon Høiberg

Simon Høiberg 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 @SimonHoiberg

Mar 14, 2023
GPT-4 is about to launch 🚀
And we're going to see something groundbreaking!

According to early announcements, GPT-4 is going to be multimodal, which means both prompts and outputs can be:

→ Text
→ Images
→ Videos
→ Audio

Instead of simply text → text as we know now. Image
Let's gooo 🚀 Image
Read 4 tweets
Mar 13, 2023
How to validate your SaaS idea *before* you start building.

→ In less than 10 days
→ For less than $200
→ In 3 simple steps

Let's see how 🧵👇
Step 1: Set up a landing page.

Describe your product idea, the features, and the problem you want to solve.

Tools:
shuffle.dev to create the landing page
chat.openai.com to create the copy
figma.com to create the graphics
On the pricing page, include a simple form to join the waiting list for your product.

Use this to collect emails.

Tools:
zapier.com to handle form submissions
airtable.com to store the emails
Read 12 tweets
Jan 11, 2023
GPT-4 is going to launch soon.
And it will make ChatGPT look like a toy...

→ GPT-3 has 175 billion parameters
→ GPT-4 has 100 trillion parameters

I think we're gonna see something absolutely mindblowing this time!

And the best part? 👇
Average developers (like myself), who are not AI or machine learning experts, will get to use this powerful technology through a simple API.

Think about this for a second...

It's the most powerful, cutting-edge technology *in the world*, available through a Low-Code solution!
If you're not already planning on starting an AI-based SaaS or thinking about how to build AI into your current solution...

👉 Start now!

Cause this is gonna be one of the biggest opportunities of this century 🚀
Read 4 tweets
Dec 27, 2022
I run a 6-figure business entirely online.

But the amount of hats I need to wear is exhausting 🤯

Luckily, I can be a:
→ Copywriter
→ Data analyst
→ Social media manager
→ Head of Operations
→ Graphic designer
→ VP of Finance
→ Web developer

...using these 7 tools ↓
🔹 TubeBuddy

I couldn't imagine running YouTube as a business without TubeBuddy.

Keyword research, channel analytics, thumbnail analysis, A/B testing and much more.

🔗 tubebuddy.com
🔹 FeedHive

FeedHive is the ultimate tool for entrepreneurs who want to build a social media presence at scale.

I gained +200K followers across 5 different platforms in < 2 years.

I've seen people go viral with FeedHive more times than I can count.

🔗 feedhive.io
Read 9 tweets
Nov 28, 2022
8 No Code tools you can use to set up a SaaS business from scratch!

🌐 Website
⚙️ Web app
📱 Mobile app
🔁 Automation

(...I bet some of these are new to you)

Let's take a look ↓
🌐 Create a stunning website for your business!

→ Shuffe (shuffle.dev)
→ Versoly (versoly.com)
⚙️ Create the actual SaaS web application.

→ Bubble (bubble.io)
→ Wized (wized.io)
Read 7 tweets
Nov 8, 2022
How to validate your SaaS idea *before* you start building.

→ In less than 10 days
→ For less than $200
→ In 3 simple steps

Let's see how 🧵👇
Step 1: Set up a landing page.

Describe your product idea, the features, and the problem you want to solve.

Tools:
shuffle.dev to create the landing page.
copy.ai to create the copy.
figma.com to create the graphics.
On the pricing page, include a simple form to join the waiting list for your product.

Use this to collect emails.

Tools:
zapier.com to handle form submissions.
airtable.com to store the emails.
Read 13 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!

:(