DEV Community

Sathish Kumar
Sathish Kumar

Posted on

JavaScript Basics:

Arrays, Functions & Callbacks:

​Here is a quick recap of some fundamental JavaScript concepts I revised today:

1.Array Length (.length):

​mark.length gives the total size (number of elements) in an array.

​ 2.Mixed Data Types in Arrays:

​JavaScript arrays can store different types of data together:

const ar = [10, 20, 30, "abc", true];

​3.The .filter() Method:

​numbers.filter(display)

​numbers ➔ Array name

​display ➔ Function passed inside .filter()

​4.Callback Functions:

​A callback function is a function passed as an argument to another function.

​Example: filterdemo(display)

​5.Arrow Functions (=>):

​A concise way to write functions in JavaScript.

Top comments (1)

Collapse
 
jonrandy profile image
Jon Randy 🎖️ •