当前位置:网站首页>面试题篇一
面试题篇一
2022-07-01 18:46:00 【王元肉】
大家一起加油,我喜欢分专栏将知识打碎成一份一份小知识点,一篇文章只说一个知识点,因此每篇文章篇幅较短,希望大家不要介意。如有需要可以查看专栏看看是否有该文章中涉及到的知识点进行讲解的文章,如果大家觉得有帮助,希望大家三连支持一下。 |
推荐阅读
事情起源
昨天晚上和女票吃完晚饭后,去给她闺蜜送点东西,到她闺蜜家后,我女票和她闺蜜在那聊这聊那,我无聊啊,我插不进去话。然后点开了QQ学习群,刚好看见一个群友发出了他面试的面试题。如下
我点开一看,第二题还行,但是我在外面啊没有电脑,然后他又说
好吧帮人帮到底,我给他发了关于第三题我写的文章
后续10点多回到家,赶紧打开电脑为其解答
第二题
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));
第三题
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");
结语
刚好学过这个知识,所以刚好复习并分享出来,大家一起学习加油,后续就是在群里巴拉巴拉找工作的事情,中途还收获了csdn两关注,哈哈哈。
结束啦!
边栏推荐
猜你喜欢
Optaplanner learning notes (I) case cloud balance
[AI server setup] CUDA environment
Technology T3 domestic platform! Successfully equipped with "Yihui domestic real-time system sylixos"
Oracle physical architecture
[Mori city] random talk on GIS data (I)
servlet知识点
Cookie和Session的相关概念
How to correctly use vertx to operate redis (3.9.4 with source code analysis)
After studying 11 kinds of real-time chat software, I found that they all have these functions
再回顾集合容器
随机推荐
Bao, what if the O & M 100+ server is a headache? Use Xingyun housekeeper!
Use the uni app demo provided by Huanxin to quickly realize one-on-one chat
Ffmpeg common commands (2)
Uni app wechat applet one click login to obtain permission function
Ubuntu14 install MySQL and configure root account local and remote access
Werewolf killing strategy: do you think I'm easy to cheat? Who do we believe!
OpenCV视频质量诊断----视频遮挡诊断
mysql 报错 Can‘t create table ‘demo01.tb_Student‘ (errno: 150)*
Analysis of GetMessage underlying mechanism
ddr4测试-2
servlet知识点
2022/5/23-2022/5/30
[English grammar] Unit1 articles, nouns, pronouns and numerals
新窗口打开页面-window.open
ffmpeg 音频相关命令
Why has instagram changed from a content sharing platform to a marketing tool? How do independent sellers use this tool?
Test self-study people must see: how to find test items in software testing?
JS的Proxy
[Mori city] random talk on GIS data (I)
Time series analysis using kibana timelion