摘要: let arr=[5,7,5,8,1,2,9,10,51,12,18,9,10,2,5]; let len=arr.length; function a(arr){ if(arr==null||arr.length<2) {return null;} let i,j; for(i=0;i<len;i 阅读全文
posted @ 2020-05-25 11:10 apple78 阅读(100) 评论(0) 推荐(0)
摘要: let arr=[5,7,5,8,1,2,9,10,51,12,18,9,10,2,5]; let len=arr.length-1; function a(arr){ if(arr==null||arr.length<2) {return null;} let i; for(let end=len 阅读全文
posted @ 2020-05-25 11:02 apple78 阅读(93) 评论(0) 推荐(0)
摘要: let arr=[5,7,5,8,1,2,9,10,51,12,18,9,10,2,5]; function a(arr){ if(arr==null||arr.length<2) {return null;} let i,j; for(i=1;i<arr.length;i++){ for(j=i- 阅读全文
posted @ 2020-05-25 10:55 apple78 阅读(93) 评论(0) 推荐(0)
摘要: let arr1=[5,7,5,8,1,2,9,10,51,12,18,9,10,2,5]; function sor1(arr,l,r){ if(l==r){ return; } let mid= Math.floor((l+r)/2); sor1(arr,l,mid); sor1(arr,mid 阅读全文
posted @ 2020-05-25 10:22 apple78 阅读(100) 评论(0) 推荐(0)
摘要: 冒泡算法:每次拿掉最后一位数 var end,i,j,tmp; arr=[2,1,8,3,6,5,9,4] function a(arr){ if(arr==null||arr.length<2){ return } for(end=arr.length-1;end>0;end--){ for(i= 阅读全文
posted @ 2020-04-27 18:30 apple78 阅读(187) 评论(0) 推荐(0)
摘要: function getByClass(clsName, parent){ //定义函数getByClass()实现获取document或指定父元素下所有class为clsName的元素 var obj=parent?document.getElementById(parent):document; 阅读全文
posted @ 2020-02-16 18:07 apple78 阅读(1844) 评论(0) 推荐(0)
摘要: 什么是跨域 简单的理解就是因为JavaScript同源策略的限制,a.com域名下的js无法操作b.com或者c.a.com域名下的对象。 http://mail.163.com/index.html http代表协议 还可以是ftp协议 file 协议telnet协议mailto协议 mail代表 阅读全文
posted @ 2020-02-13 20:18 apple78 阅读(194) 评论(0) 推荐(0)