- JavaScript
变量:名字(identifier) + 值(类型)
基础类型:栈里分配。(栈==函数调用栈)
引用类型:堆里分配。
作业:
1. 闭包与作用域:https://lucifer.ren/fe-interview/#/topics/js/scope&closures
2. 引用和操作符优先级
3. this
变量:名字(identifier) + 值(类型)
基础类型:栈里分配。(栈==函数调用栈)
引用类型:堆里分配。
作业:
1. 闭包与作用域:https://lucifer.ren/fe-interview/#/topics/js/scope&closures
2. 引用和操作符优先级
3. this
// from : https://github.com/chrisguttandin/standardized-audio-context/blob/master/test/integration/memory.js | |
const MemoryFileSystem = require('memory-fs'); // eslint-disable-line no-undef | |
const puppeteer = require('puppeteer'); // eslint-disable-line no-undef | |
const webpack = require('webpack'); // eslint-disable-line no-undef | |
// eslint-disable-next-line padding-line-between-statements | |
const compileBundle = () => { | |
return new Promise((resolve, reject) => { | |
const memoryFileSystem = new MemoryFileSystem(); |
class:
class MyComponent extends React.Component {
/* Adding state and binding custom methods */
constructor() {
super()
/** | |
* RuntimeGlobalsChecker | |
* | |
* You can use this utility to quickly check what variables have been added (or | |
* leaked) to the global window object at runtime (by JavaScript code). | |
* By running this code, the globals checker itself is attached as a singleton | |
* to the window object as "__runtimeGlobalsChecker__". | |
* You can check the runtime globals programmatically at any time by invoking | |
* "window.__runtimeGlobalsChecker__.getRuntimeGlobals()". | |
* |
#!/usr/bin/env bash | |
set -Eeuo pipefail | |
trap cleanup SIGINT SIGTERM ERR EXIT | |
script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd -P) | |
usage() { | |
cat <<EOF | |
Usage: $(basename "${BASH_SOURCE[0]}") [-h] [-v] [-f] -p param_value arg1 [arg2...] |
class BrowserDetector { | |
constructor() { | |
// 测试条件编译 | |
// IE6~10支持 | |
this.isIE_Gte6Lte10 = /*@cc_on!@*/false; | |
// 测试documentMode | |
// IE7~11支持 | |
this.isIE_Gte7Lte11 = !!document.documentMode; |
// multi-part | |
// client.mjs | |
import fs from "fs"; | |
import path, { dirname } from "path"; | |
import request from "request"; | |
import { fileURLToPath } from "url"; | |
var r = request.post("http://localhost:7001/low-code/api/v1/magic", function( | |
err, |