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. Error Code: 2006 - MySQL 5.7 server has gone away

    使用 Navicat 执行 sql 脚本失败 出现 Error Code: 2006 - MySQL server has gone away 原因 当MySQL客户端或mysqld服务器收到大于ma ...

  2. OPTIONS的预请求(Preflighted Request)

    OPTIONS的预请求(Preflighted Request) Ajax 请求中出现OPTIONS(Request Method: OPTIONS)_qiao-CSDN博客 https://blog ...

  3. websocket心跳重连 websocket-heartbeat-js

    初探和实现websocket心跳重连(npm: websocket-heartbeat-js) 心跳重连缘由 websocket是前后端交互的长连接,前后端也都可能因为一些情况导致连接失效并且相互之间 ...

  4. Python的交互模式和直接运行.py文件有什么区别

    使用文本编辑器 - 廖雪峰的官方网站 https://www.liaoxuefeng.com/wiki/1016959663602400/1017024645952992 直接输入python进入交互 ...

  5. WPF排版布局经验总结(干货)简短不疲倦

    本文不过多讲述wpf的基础布局控件,本文只记录WPF排版的技巧,这是个人的总结,不能符合所有情况,如果有何不对的地方,请评论指正,谢谢. 1.区域划分 在接手一个界面的时候,先纵观全局,将眼见的区域划 ...

  6. 通过Portainer统一管理不同服务器的Docker

    通过Portainer统一管理不同服务器的Docker 一.可视化管理工具Portainer的安装 二.跨服务器管理Docker 2.1开启2375监听端口 2.2Portainer配置远程管理 一. ...

  7. python -m http.server 搭建一个简易web下载服务器

    在打vulnhub靶场的时候遇到的一个问题 目录 一.进到需要发送的安装包目录 二.开启http服务 三.访问服务器 一.进到需要发送的安装包目录 比如设置一个专门发送,传输的文件的文件夹,cmd命令 ...

  8. Linux环境mysql快速备份及迁移

    在项目实施的过程中,经常会面临数据库迁移,导出和导出数据,如果用普通的mysql客户端备份,时间较长且容易出错.那么mysql快速备份及迁移,就成为数据库迁移的重中之重. 下面介绍我在项目实现过程中用 ...

  9. C++类基本--随笔二

    1 #include <iostream> 2 #include <string.h> 3 using namespace std; 4 5 class Internet 6 ...

  10. Animator动画状态机的简单使用

    一.动画状态机的使用 1.动画状态机说明 2.动画切换箭头的Inspector面板 3.动画的Inspector面板 二.动画状态机的使用和脚本控制 1.动画状态机的使用  2.动画状态机的控制脚本 ...