JavaScript Basics:

2026-10-06来源 dev.to CSSEnglish

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.

原文:https://www.a8q9.cn/en/article/javascript-basics-3bcb7d.html

相关文章