文章目录 一、forEach方法 二、回调函数的使用 一、forEach方法 forEach方法时数组变量调用的方法,参数有两个,一个是function,另一个是object,一般只用function的,而这个function就是回调函数。 二、回调函数的使用 <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script