当前位置:网站首页>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! !
边栏推荐
- Cookie和Session的相关概念
- Using win7 vulnerability to crack the system login password
- After studying 11 kinds of real-time chat software, I found that they all have these functions
- win10下使用msys+vs2019编译ffmpeg源码
- 集合对象值改变NULL值对象
- Learning records of building thingsboard, an Internet of things platform
- 采集抖音视频
- Remove line breaks from MySQL query results
- Test self-study people must see: how to find test items in software testing?
- 118. Yanghui triangle
猜你喜欢
pickle. Load error [attributeerror: can't get attribute 'volatile' on < module '\u main']
P2433 【深基1-2】小学数学 N 合一
Basic use of MySQL
Shell advanced
118. 杨辉三角
产品模块化设计的前世今生
How to use console Log print text?
Use the uni app demo provided by Huanxin to quickly realize one-on-one chat
GC垃圾回收
如何正确使用Vertx操作Redis(3.9.4带源码分析)
随机推荐
IPv4 address, subnet mask, gateway
P2433 [deep foundation 1-2] primary school mathematics n in one
Linux下安装Redis,并配置环境
[AI server setup] CUDA environment
Opencv video quality detection -- sharpness detection
Flutter 实战-快速实现音视频通话应用
SIP protocol of gb28181
HLS4ML报错The board_part definition was not found for tul.com.tw:pynq-z2:part0:1.0.
【let var const】
pickle. Load error [attributeerror: can't get attribute 'volatile' on < module '\u main']
Bao, what if the O & M 100+ server is a headache? Use Xingyun housekeeper!
js三元表达式复杂条件判断
为什么一定要从DevOps走向BizDevOps?
Procédure de mesure du capteur d'accord vibrant par le module d'acquisition d'accord vibrant
面试题篇一
毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?
Simplified pinduoduo product data
Remove line breaks from MySQL query results
Interview question 16.16 Partial sorting - Double finger needling
Botu V16 obtains the system time and converts it into a string