JS instanceof 的本质
JS 之父原本是 Scheme 程序员,在接到设计一门
123456function Person (name) { this.name = name}const p = new Person("lgy")console.log(p instanceof Person) /
...
1 | ["chunk", "compact", "concat", "difference", "differenceBy", "differenceWith", "drop", "dropRight", "dropRightWhile", "dropWhile", "fill", "findIndex", "findLastIndex", "first", "flatten", "flattenDeep", "flattenDepth", "fromPairs", "head", "indexOf", "initial", "intersection", "intersectionBy", "intersectionWith", "join", "last", "lastIndexOf", "nth", "pull", "pullAll", "pullAllBy", "pullAllWith", "pullAt", "remove", "reverse", "slice", "sortedIndex", "sortedIndexBy", "sortedIndexOf", "sortedLastIndex", "sortedLastIndexBy", "sortedLastIndexOf", "sortedUniq", "sortedUniqBy", "tail", "take", "takeRight", "takeRightWhile", "takeWhile", "union", "unionBy", "unionWith", "uniq", "uniqBy", "uniqWith", "unzip", "unzipWith", "without", "xor", "xorBy", "xorWith", "zip", "zipObject", "zipObjectDeep", "zipWith"] |
1 | ["countBy", "each", "eachRight", "every", "filter", "find", "findLast", "flatMap", "flatMapDeep", "flatMapDepth", "forEach", "forEachRight", "groupBy", "includes", "invokeMap", "keyBy", "map", "orderBy", "partition", "reduce", "reduceRight", "reject", "sample", "sampleSize", "shuffle", "size", "some", "sortBy"] |
1 | ["now"] |
原文链接: https://javascript.info/mousemove-mouseover-mouseout-mouseenter-mouseleave#tasks
当鼠标在DOM元素之间移动时, 会产生相应的鼠标事件. 现在让我们一起深入研究一下这些事件的细节.
当鼠标移动到一个元素上面时, 产生 mouseover
事件; 当它离开元素时, 产生 mouseout
事件.
使用两个空格进行缩进。
eslint: indent
1 | function hello (name) { |
除需要转义的情况外,字符串统一使用单引号。
对于字符串构造的html,html属性优先使用双引号,而外围使用单引号。
eslint: quotes
1 | console.log('hello there') |
不要定义未使用的变量。
eslint: no-unused-vars
1 | function myFunction () { |