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其实是一样的用法, ...
随机推荐
- 分布式跟踪的一个流行标准是OpenTracing API,该标准的一个流行实现是Jaeger项目。
https://github.com/jaegertracing/jaeger https://mp.weixin.qq.com/s/-Tn2AgyHoq8pwMun8JHcGQ Jaeger的深入分 ...
- 小步前进之WebService
WebService Web Service 什么是Web Service? 为什么使用Web Service XML 什么是XML? 为什么使用XML? SOAP(Simple Object Acc ...
- PowerQuery合并查询原理
PowerQuery的合并查询比Excel中的VLOOKUP更加强大,下面对查询的类型做一个梳理, 1.左外部(第一个中的所有行,第二个中的匹配行):用左边表内的所有行去右边找它的匹配项 2.右外部( ...
- ajax 用fom提交
$.ajax({ type : "POST", url : "${ctx}/credit/LoanauditCtrl/qwe.do?hetong="+heton ...
- dedecms织梦的安全问题解决办法
很多新手用户在使用织梦CMS程序过程中,难免会碰到挂马中毒现象,所以事先我们要对网站及服务器安全做好预防备份处理. 织梦作为国内第一大开源免费CMS程序,无疑是很多HACK研究的对象,在本身不安全的互 ...
- 怎样将Sublime Text 设置成中文版(完整教程)
1.打开Sublime Text,使用快捷键Shift+Ctrl+P,弹出查找栏,如图: 2.在搜索框中输入关键字 install ,出现下拉选项,点击选择其中的:Package Control: I ...
- Java泛型学习---第二篇
泛型学习第一篇 1.泛型之擦拭法 泛型是一种类似"模板代码"的技术,不同语言的泛型实现方式不一定相同. Java语言的泛型实现方式是擦拭法(Type Erasure). 所谓擦拭法 ...
- Codeforces Round #672 (Div. 2)
比赛链接:https://codeforces.com/contest/1420 A. Cubes Sorting 题意 给出一个大小为 $n$ 的数组 $a$,每次只可以交换相邻的两个元素,最多交换 ...
- bzoj1500: [NOI2005]维修数列 (Splay+变态题)
Time Limit: 10 Sec Memory Limit: 64 MBSubmit: 11353 Solved: 3553 [Submit][Status][Discuss] Descrip ...
- HihoCoder - 1055 树形dp
vj链接:https://vjudge.net/contest/367007#problem/G 题意: 给你一棵树,树上有n个节点,每一个节点有一个权值,树根节点是1,你需要找到以1为起点连通的m个 ...