jQuery对象是伪数组
静态方法
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>入口函数</title>
<script src="./jquery-3.4.1.min.js">
</script>
<script >
//第一这个写法
$(document).ready(function()
{
//alert("你好");
}
);
//第二种写法
jQuery(document).ready(function()
{
//alert("harmony") ;
});
//第三种写法
/*$(function()
{
alert("你好shijie");
var $box1=$("#box1");
var $p=$("<p>他是段落<p>");
console.log($p);
$box1.append($p);
}
);*/
var arr=[1,3,5,7,9];
//var obj=[0:1,1:3,2:5,3:7,4:9,length:5];
arr.forEach(function(value,index)
{
console.log(index,value);
}
);
//第四种写法
jQuery(function()
{
//alert("你好,欢迎进入数学的世界");
}
);
</script>
</head>
<body>
<div id="box1">
</div>
</body>
</html>
可以看见数组元素
map