![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_224,w_224)
ES6的介绍
介绍ES6以上新的特性,以加深自己的了解
全渣工程师JsonWang
一个很渣,很懒的,但是想上进的全渣工程师
展开
-
js常用的循环,for of 和 for in等比较
1、for…in 循环:只能获得对象的键名,不能获得键值 for…of 循环:允许遍历获得键值 var arr = ['red', 'green', 'blue'] for(let item in arr) { console.log('for in item', item) } /* for in item 0 for in item 1 for in item 2 */ for(let item of arr) { console.log('for of item', ite原创 2021-07-08 10:26:30 · 312 阅读 · 0 评论 -
git 的常用命令
git的复制粘贴 Ctrl+ins 复制 Shift+ins 粘贴 git拉代码 git clone https://xxxxxx/xxxx.git git commit 提交 git commit -am “init” 提交并且加注释 git push origin master 将文件给推到服务器上 git pull 本地与服务器端同步 ...原创 2021-07-05 14:36:07 · 154 阅读 · 0 评论 -
元素属性操作
1.获取元素的属性 js获取属性 /*js获取属性*/ var temp = document.getElementById('href').getAttribute('data-id'); console.log("???? ~ file: A001获取元素属性.js ~ line 12 ~ temp", temp) jq获取属性 /*jq获取属性*/ var temp = $('.href').attr('href'); console.log("???? ~ file: A001获取元素属性.js原创 2021-06-28 20:17:06 · 122 阅读 · 0 评论 -
jsvascript中的this问题以及改变this指向
this常用的几种情况 默认情况下this是引用全局对象window console.log(this) // window 在函数中,当不处于严格模式时,this指的是全局对象。 function fn(){ console.log(this) //window } fn() 在函数中严格模式时是undefined function fn() { 'use strict'; //或者是"use strict"; console.log(this)...原创 2021-02-18 16:11:49 · 138 阅读 · 0 评论