console.log & front-end jobs
console.log & front-end jobs

bind & function
let log = console.log;
let obj = {};
log(obj);
log(typeof Function.prototype.bind);
log(typeof Function.prototype.bind());
log(Function.prototype.bind.name);
log(Function.prototype.bind().name);
//{}
//function
//function
//bind
//bound 
Function.prototype;
//ƒ () { [native code] }
Function.prototype.bind;
//ƒ bind() { [native code] }
Function.prototype.bind();
//ƒ () { [native code] }
Function.prototype.bind.name;
//"bind"
Function.prototype.bind().name;
// "bound "

https://zhuanlan.zhihu.com/p/50539121
vanilla js customize bind this
"use strict";
/**
 *
 * @author xgqfrms
 * @license MIT
 * @copyright xgqfrms
 * @created 2019-08-31
 * @modified
 *
 * @description vanilla js customize bind this
 * @augments
 * @example
 * @link
 *
 */
let log = console.log;
let obj = {
    x: 42,
    getX: function() {
        log(`this =`, this);
        log(`obj.x =`, obj.x);
        return this.x;
    }
};
// The function gets invoked at the global scope
let unboundGetX = obj.getX;
// log(unboundGetX());
// undefined
let boundGetX = unboundGetX.bind(obj);
// log(boundGetX());
// 42
Function.prototype.customizeBind = function() {
    let func = this;
    let _this = arguments[0];
    // arguments is array-like, not an array!
    // let args = Array.prototype.slice.apply(arguments,[1]);
    let args = [...arguments].slice(1);
    // log(`func =`, func);
    // log(`_this =`, _this);
    // log(`args =`, args);
    if (typeof func === "function") {
        return function() {
            let allArgs = args.concat([...arguments].slice(0));
            // log(`allArgs =`, allArgs);
            return func.apply(_this, allArgs);
        };
    } else {
        throw new Error(`Function.prototype.customizeBind - what is you trying to be bound is not callable!`);
    }
};
let customizeBoundGetX = unboundGetX.customizeBind(obj);
log(customizeBoundGetX());
ASCII text art
console.log(`%c
                                  _____                   _______                   _____                    _____                    _____                    _____
        ______                   /\    \                 /::\    \                 /\    \                  /\    \                  /\    \                  /\    \
       |::|   |                 /::\    \               /::::\    \               /::\    \                /::\    \                /::\____\                /::\    \
       |::|   |                /::::\    \             /::::::\    \             /::::\    \              /::::\    \              /::::|   |               /::::\    \
       |::|   |               /::::::\    \           /::::::::\    \           /::::::\    \            /::::::\    \            /:::::|   |              /::::::\    \
       |::|   |              /:::/\:::\    \         /:::/~~\:::\    \         /:::/\:::\    \          /:::/\:::\    \          /::::::|   |             /:::/\:::\    \
       |::|   |             /:::/  \:::\    \       /:::/    \:::\    \       /:::/__\:::\    \        /:::/__\:::\    \        /:::/|::|   |            /:::/__\:::\    \
       |::|   |            /:::/    \:::\    \     /:::/    / \:::\    \     /::::\   \:::\    \      /::::\   \:::\    \      /:::/ |::|   |            \:::\   \:::\    \
       |::|   |           /:::/    / \:::\    \   /:::/____/   \:::\____\   /::::::\   \:::\    \    /::::::\   \:::\    \    /:::/  |::|___|______    ___\:::\   \:::\    \
 ______|::|___|___ ____  /:::/    /   \:::\ ___\ |:::|    |     |:::|    | /:::/\:::\   \:::\    \  /:::/\:::\   \:::\____\  /:::/   |::::::::\    \  /\   \:::\   \:::\    \
|:::::::::::::::::|    |/:::/____/  ___\:::|    ||:::|____|     |:::|____|/:::/  \:::\   \:::\____\/:::/  \:::\   \:::|    |/:::/    |:::::::::\____\/::\   \:::\   \:::\____\
|:::::::::::::::::|____|\:::\    \ /\  /:::|____| \:::\   _\___/:::/    / \::/    \:::\   \::/    /\::/   |::::\  /:::|____|\::/    / ~~~~~/:::/    /\:::\   \:::\   \::/    /
 ~~~~~~|::|~~~|~~~       \:::\    /::\ \::/    /   \:::\ |::| /:::/    /   \/____/ \:::\   \/____/  \/____|:::::\/:::/    /  \/____/      /:::/    /  \:::\   \:::\   \/____/
       |::|   |           \:::\   \:::\ \/____/     \:::\|::|/:::/    /             \:::\    \            |:::::::::/    /               /:::/    /    \:::\   \:::\    \
       |::|   |            \:::\   \:::\____\        \::::::::::/    /               \:::\____\           |::|\::::/    /               /:::/    /      \:::\   \:::\____\
       |::|   |             \:::\  /:::/    /         \::::::::/    /                 \::/    /           |::| \::/____/               /:::/    /        \:::\  /:::/    /
       |::|   |              \:::\/:::/    /           \::::::/    /                   \/____/            |::|  ~|                    /:::/    /          \:::\/:::/    /
       |::|   |               \::::::/    /             \::::/____/                                       |::|   |                   /:::/    /            \::::::/    /
       |::|   |                \::::/    /               |::|    |                                        \::|   |                  /:::/    /              \::::/    /
       |::|___|                 \::/____/                |::|____|                                         \:|   |                  \::/    /                \::/    /
        ~~                                                ~~                                                \|___|                   \/____/                  \/____/
`, `color: #0f0; background: #000;`);
http://patorjk.com/software/taag/#p=display&h=0&v=0&f=Alpha&t=xgqfrms

refs
http://www.alloyteam.com/2020/01/14184/#prettyPhoto

    //Alloyteam 招聘广告
    window.console && console.log && console.log("\n"+"   _    _  _                _____                         \n  \/_\\  | || |  ___   _   _ \/__   \\  ___   __ _  _ __ ___  \n \/\/_\\\\ | || | \/ _ \\ | | | |  \/ \/\\\/ \/ _ \\ \/ _` || '_ ` _ \\ \n\/  _  \\| || || (_) || |_| | \/ \/   |  __\/| (_| || | | | | |\n\\_\/ \\_\/|_||_| \\___\/  \\__, | \\\/     \\___| \\__,_||_| |_| |_|\n                     |___\/\n\n 欢迎加入AlloyTeam:请将简历(邮件标题后面再加上'from console')发送至 %c Kinvix@QQ.com \n", "color:red");
xgqfrms 2012-2020
www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!
console.log & front-end jobs的更多相关文章
- [AST Babel Plugin] Transform code, add line:column number for console log
		For example we have current code: function add(a, b) { console.log(a, b) return a + b } function sub ... 
- const let,console.log('a',a)跟console.log('a'+a)的区别
		const 创建一个只读的常量 let块级作用域 const let重复赋值都会报错 console.log('a',a) a console.log('a'+a) a2 逗号的值会有空格:用加号的值 ... 
- console.log("A"-"B"+"3")=?
		(点击上方的订阅号,可快速关注,关注有惊喜哦^_^) 前不久看到一道JS基础题目,做了一下竟然错了一半...在此分享一下: 先把题目放上来,大家可以自己测试一下再看答案哦^_^ ①console.lo ... 
- javascript的console.log用法
		f1.html代码 <iframe id="frame2" name="frame1" src="ww.html"></i ... 
- alert()与console.log()的区别
		[1]alert() [1.1]有阻塞作用,不点击确定,后续代码无法继续执行 [1.2]alert()只能输出string,如果alert输出的是对象会自动调用toString()方法 e.g. al ... 
- console.log((function f(n){return ((n > 1) ? n * f(n-1) : n)})(5))调用解析
		console.log((function f(n){) ? n * f(n-) : n)})()); 5被传入到函数,函数内部三元计算,5 > 1成立,运算结果是5*f(4),二次运算,5*4 ... 
- JS高级群的日常!写一个从10到0的倒计时,用console.log打印,不可以用 setInterval!本来说好的研究avalonJS最后演变成了看着大神在那边互相比拼实力。。
		JS高级群的日常!写一个从10到0的倒计时,用console.log打印,不可以用 setInterval!本来说好的研究avalonJS最后演变成了看着大神在那边互相比拼实力.. 小森执行一 ... 
- console.dir() 与 console.log() 区别
		Difference console.log prints the element in an HTML-like tree console.dir prints the element in a J ... 
- 简述alert和console.log的区别
		生活中还是得有发现美好和差别的眼睛~~ 学习前端那么久既然还不知道alert和console.log的差别~~~~ 蓝瘦,香菇~~~ 本菜鸟一直以为alert和console.log其实是一样的用法, ... 
随机推荐
- map 传递给函数的代价
			https://github.com/unknwon/the-way-to-go_ZH_CN/blob/master/eBook/08.1.md map 传递给函数的代价很小:在 32 位机器上占 4 ... 
- Salt (cryptography)
			Salt (cryptography) Here is an incomplete example of a salt value for storing passwords. This first ... 
- Java中运行javascript代码
			Java中运行javascript代码 1.Java 代码 2.JS代码 2.1demoWithParams.js 2.2demoWithListParams.js 原文作者:russle 原文地址: ... 
- Linux踩坑填坑记录
			Linux踩坑填坑记录 yum安装失败[Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.aliyun.com'" ... 
- ubuntu虚拟机重启后进入initramfs的解决办法
			问题:windows下使用VMware或者自己安装的ubuntu系统出现,不能正常进入系统,而是进入一个以initramfs开头的命令行界面! 原因:不正常的关闭系统,导致系统文件损坏,/dev/sd ... 
- OSPF特殊区域和LSA
			OSPF路由计算优选次序: (1) 直连路由:本路由器发起的LSA 1.2: (2) 区域内路由:O: LSA 1.2: (3) 区域间路由:O IA: LSA 3: (4) 1类外部路由:O E1: ... 
- 深入理解Java虚拟机读书笔记 -- Java内存区域
			Graal VM: Run Programs Faster Anywhere. 跨语言全栈虚拟机,可以作为"任何语言"的运行平台使用. Java内存结构 程序计数器:线程私有,较小 ... 
- 最小生成树-Prim&Kruskal
			Prim算法 算法步骤 S:当前已经在联通块中的所有点的集合 1. dist[i] = inf 2. for n 次 t<-S外离S最近的点 利用t更新S外点到S的距离 st[t] = true ... 
- Jenkins(2)docker容器中安装python3
			前言 使用docker安装jenkins环境,jenkins构建的workspace目录默认是在容器里面构建的,如果我们想执行python3的代码,需进容器内部安装python3的环境. 进jenki ... 
- Codeforces Round #626 (Div. 2) B. Count Subrectangles
			题目连接:https://codeforces.com/contest/1323/problem/B 题意:给一个大小为n的a数组,一个大小为m的b数组,c数组是二维数组c[i][j]=a[i]*b[ ... 
