随笔分类 -  面试题

摘要:3-23 请手动封装 fn(1)(2) 返回 3 的结果,要考虑参数会增加或减少的情况,例如:fn(1)(2)(3) 返回 6https://juejin.cn/post/6850418115042836487 https://blog.csdn.net/double_sweet1/article/details/122786636?utm_medium=distribute.pc_aggpage_search_resul 阅读全文
posted @ 2022-03-23 08:42 林见夕 阅读(143) 评论(0) 推荐(0) 编辑
摘要:3-22 跨域是什么?有哪些解决方式?跨域出现的原因,是因为浏览器的同源策略导致,即 协议 域名 端口号 不一致, 如何解决 代理服务器 nginx 使用代理服务,帮助我们请求接口,在响应回来给到浏览器 jsonp 利用 script 标签,天然跨域特性 ,仅支持 get CORS 服务器端开启 CORS proxy 代理 等 阅读全文
posted @ 2022-03-22 22:32 林见夕 阅读(37) 评论(0) 推荐(0) 编辑
摘要:3-22 如何确定首屏加载时间?如何确定首屏加载时间? 首屏时间的定义: 浏览器显示第一屏页面所消耗的时间,以 800x600 像素尺寸为标准,从开始加载到浏览器页面显示高度达到 600 像素且此区域有内容显示的时间。 也就是说用户能够看到区域内所有元素加载完的时间。 一个页面的“总加载时间”要比“首屏时间”长,但对于最终用户体验 阅读全文
posted @ 2022-03-22 22:26 林见夕 阅读(604) 评论(0) 推荐(0) 编辑
摘要:3-22 Css实现自适应屏幕宽度的正方形方式一:padding + 百分比 <style> html, body { margin: 0; padding: 0; } .outer { width: 20%; height: 0; padding-bottom: 20%; background-color: red; } </style> 阅读全文
posted @ 2022-03-22 21:31 林见夕 阅读(197) 评论(0) 推荐(0) 编辑
摘要:3-10 基础面试题1. arr.filter(Boolean) 的结果是 [0, 1, 2, 3, -1, null, "", 3, 5, 7].filter(Boolean); 等同与 [0, 1, 2, 3, -1, null, "", 3, 5, 7].filter((item) => Boolean(item 阅读全文
posted @ 2022-03-10 21:50 林见夕 阅读(61) 评论(0) 推荐(0) 编辑
摘要:3-10 实现拖拽缩放盒子的效果需求讲解 画一个矩形,拖拽矩形的4个角可以将矩形缩放(缩小到顶点时,顶点需要固定),在矩形上按住拖动,可以移动该矩形的位置 <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" conten 阅读全文
posted @ 2022-03-10 18:13 林见夕 阅读(198) 评论(0) 推荐(0) 编辑
摘要:3-9 less-loader 的less 转成 css 的底层原理Less是CSS预处理语言,扩展了CSS语言,增加了变量、Mixin、函数等特性,Less-loader的作用就是将less代码转译为浏览器可以识别的CSS代码。 // demo.less @base: #f938ab; .box-shadow(@style, @c) when (iscolor(@ 阅读全文
posted @ 2022-03-09 22:31 林见夕 阅读(801) 评论(0) 推荐(0) 编辑
摘要:3-3 setTimeout 模拟 setInterval var timer; var i = 1; timer = function () { i++; console.log(i); if (i 10) { timer = function () { console.log("终止运行"); } } setTimeout(timer, 3000); } 阅读全文
posted @ 2022-03-03 22:36 林见夕 阅读(121) 评论(0) 推荐(0) 编辑
摘要:3-3 前端跨域解决方案十种跨域解决方案 https://juejin.cn/post/6844904126246027278#heading-33 阅读全文
posted @ 2022-03-03 22:16 林见夕 阅读(24) 评论(0) 推荐(0) 编辑
摘要:3-3 实现一个搜索列表组件题目要求 查询触发条件 搜索框敲击回车 点击“Search”按钮 查询中,显示“Loading” 查询无结果时,显示“查无结果” 滚动列表时,支持懒加载 <!-- page页面 --> <template> <div class="search-container"> <input type="te 阅读全文
posted @ 2022-03-03 20:22 林见夕 阅读(247) 评论(0) 推荐(0) 编辑
摘要:3-3 实现左右布局题目要求 左侧:宽度固定150px,高度自动撑开,和右侧同高 右侧:宽度自适应,高度自动撑开,和左侧同高 代码实现 <div class="container"> <div class="left"></div> <div class="right"></div> </div> body{ marg 阅读全文
posted @ 2022-03-03 15:05 林见夕 阅读(65) 评论(0) 推荐(0) 编辑
摘要:3-3 版本比较/** * 版本比较 * @param {*} a * @param {*} b */ function compare(a, b) { let arr1 = a.split('.'); let arr2 = b.split('.') const maxLength = Math.max(arr1. 阅读全文
posted @ 2022-03-03 15:03 林见夕 阅读(66) 评论(0) 推荐(0) 编辑
摘要:3-3 查找重复数字题目要求 实现一个方法sameNumbers,找出同时存在于两个数组的所有数字 需要处理异常传参,情况不限于: 未传入arr1或arr2 arr1或arr2不是数组 字符串格式的数字需要转为数字,如:'1'需先转化为1再进行查重比较 返回结果需要过滤所有非数字项 代码实现 // 思路:给 obj 新 阅读全文
posted @ 2022-03-03 15:01 林见夕 阅读(153) 评论(0) 推荐(0) 编辑
摘要:浮动元素如何水平居中如何让一个浮动元素水平居中 最简单的办法,向右推移50%,然后在平移自身宽度的一半 .box{ width: 700px; height: 400px; border: 1px solid #000; } .con{ width: 200px; height: 100px; float: left; 阅读全文
posted @ 2019-10-08 18:19 林见夕 阅读(2546) 评论(0) 推荐(0) 编辑
摘要:粘连布局实现的三种方式粘连布局 所谓粘连布局就是当内容容器没有超出时,footer是紧贴咋底部的,当内容超出的时候,footer紧随在内容容器之后,并不会超出容器。 OK,我们来看一副图,来了解粘连布局的效果 方法一 min-height: 设置最小高度,用于挤开footer,margin-top:-100px;使foo 阅读全文
posted @ 2019-10-02 20:21 林见夕 阅读(439) 评论(0) 推荐(0) 编辑

🚀
回顶
收起
点击右上角即可分享
微信分享提示
  1. 1 404 not found REOL
404 not found - REOL
00:00 / 00:00
An audio error has occurred.