𝗙𝗶𝗿𝘀𝘁 𝗢𝗿𝗱𝗲𝗿 𝘃𝘀 𝗙𝗶𝗿𝘀𝘁 𝗖𝗹𝗮𝘀𝘀 𝗙𝘂𝗻𝗰𝘁𝗶𝗼𝗻𝘀

People confuse first order and first class functions in JavaScript.

First Order Functions

A first order function is a basic function.

Example: function multiply(a, b) { return a * b; }

This function takes numbers. It returns a number. No other functions are involved.

First Class Functions

JavaScript supports first class functions. This means functions act like normal values.

You do these things with first class functions:

The Difference

These two terms are not opposites.

Simple View:

Source: https://dev.to/rishadkarappa/first-order-function-vs-first-class-functions-javascript-many-beginners-get-confused-between-12bk