当前位置:网站首页>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! !
边栏推荐
- Use the uni app demo provided by Huanxin to quickly realize one-on-one chat
- 音视频、编解码相关电子书、小工具,打包奉送!
- 集合对象值改变NULL值对象
- Redo和Undo的区别
- ModSim基本使用(Modbus模拟器)
- win10下使用msys+vs2019编译ffmpeg源码
- Ffmpeg avframe to cv:: mat
- 【let var const】
- How to use console Log print text?
- Interview questions for audio and video positions in Dachang -- today's headline
猜你喜欢

Salesmartly has some tricks for Facebook chat!

为定时器和延时器等其它情况的回调函数绑定当前作用域的this

Uni app wechat applet one click login to obtain permission function

Interview questions for audio and video positions in Dachang -- today's headline

再回顾集合容器

Basic use of MySQL

118. Yanghui triangle

音视频、编解码相关电子书、小工具,打包奉送!

DTD modeling

Test self-study people must see: how to find test items in software testing?
随机推荐
H264 encoding profile & level control
【无标题】
ModSim基本使用(Modbus模拟器)
Shell高级进阶
微信小程序 navigator点击后有阴影 ,去掉navigator阴影效果
Ffmpeg audio related commands
Wechat applet navigator has a shadow after clicking. Remove the shadow effect of navigator
wireshark报文分析tcp,ftp
JDBC中如何添加事务
Shell advanced
再回顾集合容器
类加载机制
JS ternary expression complex condition judgment
optaplanner学习笔记(一)案例Cloud balance
安装sharp报错
tensorflow报错Could not load dynamic library ‘libcudnn.so.8
Bao, what if the O & M 100+ server is a headache? Use Xingyun housekeeper!
博途V16 获取系统时间转换成字符串
Salesmartly has some tricks for Facebook chat!
JVM内存模型