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的更多相关文章

  1. [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 ...

  2. const let,console.log('a',a)跟console.log('a'+a)的区别

    const 创建一个只读的常量 let块级作用域 const let重复赋值都会报错 console.log('a',a) a console.log('a'+a) a2 逗号的值会有空格:用加号的值 ...

  3. console.log("A"-"B"+"3")=?

    (点击上方的订阅号,可快速关注,关注有惊喜哦^_^) 前不久看到一道JS基础题目,做了一下竟然错了一半...在此分享一下: 先把题目放上来,大家可以自己测试一下再看答案哦^_^ ①console.lo ...

  4. javascript的console.log用法

    f1.html代码 <iframe id="frame2" name="frame1" src="ww.html"></i ...

  5. alert()与console.log()的区别

    [1]alert() [1.1]有阻塞作用,不点击确定,后续代码无法继续执行 [1.2]alert()只能输出string,如果alert输出的是对象会自动调用toString()方法 e.g. al ...

  6. 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 ...

  7. JS高级群的日常!写一个从10到0的倒计时,用console.log打印,不可以用 setInterval!本来说好的研究avalonJS最后演变成了看着大神在那边互相比拼实力。。

      JS高级群的日常!写一个从10到0的倒计时,用console.log打印,不可以用 setInterval!本来说好的研究avalonJS最后演变成了看着大神在那边互相比拼实力..   小森执行一 ...

  8. console.dir() 与 console.log() 区别

    Difference console.log prints the element in an HTML-like tree console.dir prints the element in a J ...

  9. 简述alert和console.log的区别

    生活中还是得有发现美好和差别的眼睛~~ 学习前端那么久既然还不知道alert和console.log的差别~~~~ 蓝瘦,香菇~~~ 本菜鸟一直以为alert和console.log其实是一样的用法, ...

随机推荐

  1. udp 连接

    在今天的内容里,我对 UDP 套接字调用 connect 方法进行了深入的分析.之所以对 UDP 使用 connect,绑定本地地址和端口,是为了让我们的程序可以快速获取异步错误信息的通知,同时也可以 ...

  2. Understanding go.sum and go.mod file in Go

    https://golangbyexample.com/go-mod-sum-module/ Understanding go.sum and go.mod file in Go (Golang) – ...

  3. 2021年Web开发的7大趋势

    技术发展日新月异,所以 Web 开发人员也需要及时了解行业最新的发展趋势. 全球有超过 17.4 亿个网站.在每一个细分领域都有无数企业争夺搜索引擎的排名前列位置.开发人员应该了解和发现更多创新的 W ...

  4. CF1416D 做题心得

    CF1416D 做题心得 上次在某trick中提到了这个题,一开始觉得太毒瘤没有写,现在把它补上了. 感觉实现这个东西,比单纯收获一个trick,收获的东西多太多了. 主要思路 它的主要trick是& ...

  5. 知道 Redis-Cluster 么?说说其中可能不可用的情况

    Redis 集群模式简述 一个集群模式的官方推荐最小最佳实践方案是 6 个节点,3 个 Master 3 个 Slave 的模式,如 图00 所示. key 分槽与转发机制 Redis 将键空间分为了 ...

  6. koa2+koa-generator+mysql快速搭建nodejs服务器

    koa2+koa-generator+mysql快速搭建nodejs服务器 用koa的脚手架koa-generator可以快速生成项目骨架,可以用于发开或者测试接口 https://github.co ...

  7. SSM框架搭建详细解析

    总结了一下搭建SSM框架流程,在以后用到的时候方便回头使用. 使用工具:MyEclipse 2015:Tomcat 8版本:jdk1.8版本. 首先: 1:创建一个WebProject项目,jdk1. ...

  8. SealClient

    import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import ja ...

  9. shell(shell函数、shell正则表达式)

    本章内容 shell函数 shell正则表达式 1.shell函数 linux shell 可以用户定义函数,然后在shell脚本中可以随便调用. 格式: funname () { CMD #函数体 ...

  10. 学习一下 SpringCloud (四)-- 服务降级、熔断 Hystrix、Sentinel

    (1) 相关博文地址: 学习一下 SpringCloud (一)-- 从单体架构到微服务架构.代码拆分(maven 聚合): https://www.cnblogs.com/l-y-h/p/14105 ...