blog
blog copied to clipboard
:books: 学习心得
## 移动端适配及原理 ### 什么是移动端适配 在不同尺寸的移动设备上,让页面达到合理的展示或者说**等比缩放展示**。 ### 分辨率 - 逻辑分辨率:它是软件和硬件(物理分辨率)之间的一个转换层,可通过 `window.screen.width` 获取宽度,视口大小就是参照该值进行缩放。 - 物理分辨率:它是设备硬件固有的分辨率,出厂后就固定,可通过查看设备屏幕参数获取,也可通过 `window.screen.width * window.devicePixelRatio` 获取。 **历代 iphone 分辨率:** | 设备 | 逻辑分辨率 | 物理分辨率 | dpr = 物理分辨率...
## 盘点 TypeScript 中的易混淆点 > 本文所有示例均可在 [Playground](https://www.typescriptlang.org/play/index.html) 验证 😄 ### any VS unknown VS void VS never **any** `any` 用来表示可以赋值为任意类型,包括 `any` 类型值的属性和方法,所有类型都能被赋值给它,它也能被赋值给其他任何类型,在 TypeScript 中尽量避免使用 ```ts let anyThing: any = 'hello'...
## Git 常用指令 & 技巧 #### 远程仓库 ``` # 查看远程仓库地址 git remote -v # 添加远程仓库地址 git remote add origin [url] # 删除远程仓库地址 git remote rm origin # 重置远程仓库地址 git remote...
> 做个有想法的开发者。做事情要常常问自己:是什么?为什么?怎么做?了解原理? > **「学前端」** 公众号,只搞技术不搞广告文,欢迎关注~ ### 第一次 20:00 #### 电话一面 - 自我介绍 - 对公司工程化做过哪些事情 - localStorage、cookie 区别 - 正则预检?(没听说过) - 什么是跨域,如何解决 - vue 3 与 vue 2 的区别 - 前端性能优化...
 > 作者:[gauseen](https://github.com/gauseen) > 原文:[https://github.com/gauseen/blog](https://github.com/gauseen/blog) ### new Date() 获取当前日期相信大家都知道,如下: ```js // 如果没有输入任何参数,则 Date 的构造器会依据系统设置的当前时间来创建一个 Date 对象 new Date() Thu Apr 16 2020 13:55:25 GMT+0800 (中国标准时间) ``` 是否注意到 `GMT+0800` 标识是什么意思?又是如何计算的呢? ###...
### :ideograph_advantage: 收集前端技术、学习方法、心得 #### :mortar_board: 技能图谱 [skill-map](https://github.com/TeamStuQ/skill-map) #### :pencil2: 博客(blog) [weekly 阮一峰](https://github.com/ruanyf/weekly) [蚂蚁数据团队](https://github.com/ProtoTeam/blog) [jawil](https://github.com/jawil/blog) [DDFE blog](https://github.com/DDFE/DDFE-blog) [muwoo](https://github.com/muwoo/blogs) [lin-xin 林鑫](https://github.com/lin-xin/blog) [berwin 博文](https://github.com/berwin/Blog) [75team w3c](https://github.com/75team/w3c) [Pines-Cheng](https://github.com/Pines-Cheng/blog) [xd-tayde 郭东东](https://github.com/xd-tayde/blog) [camsong blog](https://github.com/camsong/blog) [网易 木易杨](https://github.com/yygmind/blog)...
### Koa.js `Koa.js` 是一个极其精简的 Web 服务框架,主要提供以下功能: - `HTTP` 服务:主要处理 `request` 和 `response` - 中间件数据处理机制(洋葱模型) ### 什么是 AOP? `AOP` 为 Aspect Oriented Programming 的缩写,中文意思为:**面向切面编程**,它是[**函数式编程**][functional_programming]的一种衍生范式 举个栗子 :chestnut: : 假如我想把一个**苹果**(源数据)处理成**果盘**(最终数据)我该怎么做? ① 苹果(源数据) ---->...
> 作者:[gauseen](https://github.com/gauseen "gauseen") > 原文: https://github.com/gauseen/blog ### 说一说本篇文章讲哪些点 相信在工作中经常遇到,文件上传、图片压缩、文件下载、大文件断点续传,等等关于 js 来操作文件的需求。那么你真的了解文件类型之间的转换关系吗?如下: - `Blob` --> `File` - `File` --> `DataURL(base64)` - `File` --> `BlobURL` - `HTTPURL| DataURL | BlobURL` --> `Blob`...
### 什么是跨域? 先看一下 `URL` 有哪些部分组成,如下: ``` https://github.com:80/gauseen/blog?issues=1#note \___/ \________/ \_/ \_________/ \______/ \___/ | | | | | | protocol host port pathname search hash ``` **protocol(协议)、host(域名)、port(端口)有一个地方不同都会产生跨域现象,也被称为客户端同源策略** ### 本地存储受同源策略限制 客户端(浏览器)出于安全性考虑,无论是...
> this 在函数定义的时候是确定不了的,只有函数执行的时候才能确定 this 的指向 ### 一、调用函数 this 默认指向 #### (1)正常的函数调用 ##### // 1.1.1 ```javascript function fn1(){ console.log(this); //window } fn1(); function fn2(){ 'use strict' console.log(this); //undefined } fn2(); ```...