当前位置:网站首页>Interview question 1
Interview question 1
2022-07-01 19:46:00 【Wang yuanrou】
Wang yuanrou ==> Personal home page
| Come on, everybody , I like to break knowledge into small knowledge points by columns , Just say a piece of knowledge , Therefore, each article is short , I hope you don't mind . If necessary, you can check the column to see if there are articles to explain the knowledge points involved in this article , If you think it helps , I hope you will support me for the third time in a row . |
Recommended reading
Article structure
The origin of things
Last night, after dinner with female ticket , Go and send something to her best friend , After arriving at her best friend's house , My girl ticket and her best friend are chatting here and there , I'm bored , If I can't get in . Then he clicked on QQ Study Group , I just saw a group of friends send out the interview questions for his interview . as follows

I'll open it , The second question is OK , But I'm outside. I don't have a computer , Then he said

Well, help people to the end , I sent him the article I wrote about the third question
Section oriented programming AOP
follow-up 10 Come home at more than ten , Turn on the computer and answer it
The second question is
const adjoin = function(arr, callback) {
let result = [];
let bridge = [];
arr.forEach(function(item) {
callback(item) ?
bridge.push(item) : (() => {
bridge.length > 0 ? result.push(bridge) : null;
result.push(item);
bridge = [];
})()
})
if (bridge.length > 0) result.push(bridge);
return result;
}
console.log(adjoin([1, 2, 3, 4, 5], item => item !== 3));
console.log(adjoin([1, 2, 3, 4], item => item < 3));


Third question
Function.prototype.eatFirst = function(msg) {
const _this = this;
return function() {
(function() {
console.log(`Eat ${
msg}~`);
})(...arguments)
_this.call(this, ...arguments);
};
};
Function.prototype.eat = function(msg) {
const _this = this;
return function() {
_this.call(this, ...arguments);
(function() {
console.log(`Eat ${
msg}~`);
})(...arguments)
};
};
function ManBehavior(msg) {
console.log(`Hi This is ${
msg}!`);
}
ManBehavior.call(ManBehavior, "Hank");
console.log("-------------");
ManBehavior.eat("dinner").eat("supper").call(ManBehavior, "Hank");
console.log("-------------");
ManBehavior.eat("dinner").eatFirst("lunch").call(ManBehavior, "Hank");
console.log("-------------");
ManBehavior
.eat("dinner")
.eatFirst("lunch")
.eatFirst("breakfast")
.call(ManBehavior, "Hank");


Conclusion
Just learned this knowledge , So just review and share , Let's learn together. Come on , The next step is to find a job in Balabala in the Group , I got something on the way csdn Two concerns , Ha ha ha .
The end! !
边栏推荐
- 703. The k-th element in the data flow
- CMU AI PhD first year summary
- 博途V16 获取系统时间转换成字符串
- mysql 報錯 Can‘t create table ‘demo01.tb_Student‘ (errno: 150)*
- pickle. Load error [attributeerror: can't get attribute 'volatile' on < module '\u main']
- 2022/5/23-2022/5/30
- JS ternary expression complex condition judgment
- 118. 杨辉三角
- Opencv video quality detection -- sharpness detection
- Define dichotomy lookup
猜你喜欢

【AI服务器搭建】CUDA环境

Wireshark packet analysis TCP, FTP

毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?

通过js实现金字塔(星号金字塔,回文对称数字金字塔)

Shell高级进阶

How to configure webrtc video streaming format for easygbs, a new version of national standard gb28181 video platform?

如何正确使用Vertx操作Redis(3.9.4带源码分析)

uni-app微信小程序一键登录获取权限功能

为什么一定要从DevOps走向BizDevOps?
![[AI server setup] CUDA environment](/img/ca/2acfc42ea3ba24934a89472a8632f6.png)
[AI server setup] CUDA environment
随机推荐
Ffmpeg common commands (2)
Wechat applet navigator has a shadow after clicking. Remove the shadow effect of navigator
【let var const】
uni-app微信小程序一键登录获取权限功能
Use the uni app demo provided by Huanxin to quickly realize one-on-one chat
Wireshark packet analysis TCP, FTP
P2433 [deep foundation 1-2] primary school mathematics n in one
Actual combat of flutter - fast implementation of audio and video call application
Live HLS protocol
uni-app商品分类
解决VSCode下载慢或下载失败的问题
一个程序员如何快速成长
Redo和Undo的区别
GB28181之SIP协议
[research materials] iResearch tide Watching: seven major trends in the clothing industry - Download attached
DTD modeling
微信小程序 navigator点击后有阴影 ,去掉navigator阴影效果
Mysql查询结果去除换行
MySQL reports an error can't create table 'demo01 tb_ Student‘ (errno: 150)*
New window open page -window open