RainBow

Results 78 comments of RainBow

## 004. 数组,对象映射优化 if... else... - `switch-case` ```js function getWeekDay() { let day = new Date().getDay(); switch (day) { case 0: return "天"; case 1: return "一"; case 2: return...

## 005. 从数组循环的 forEach 方法中删除元素 ```js let data = [ { name: "蔬菜类", thumb_img: "", price: 30, desc: "茄子", goods_id: "4", num: 1 }, { name: "越南进口红心火龙果 4个装", thumb_img: "",...

## 006. 优化表单验证逻辑判断 ```js 提交 ``` - 方法一:`数组遍历判断` ```js var vm = new Vue({ el: "#app", data: { username: "", phone: "", pwd: "" }, methods: { submit: function() {...

## 007. JS 的加减乘除运算 将浮点数 toString 后记录小数位的长度,然后将小数点抹掉,完整的代码如下: > Math.pow() 函数返回基数(base 例:10)的指数(exponent 例:2)次幂,Math.pow(10,2) = 100 ```js /** * 加法 * @param arg1 * @param arg2 * @returns **/ function accAdd(arg1, arg2)...

## 008. VSCode - ESLint, Prettier & Airbnb Setup ### 1. Install ESLint & Prettier extensions for VSCode Optional - Set format on save and any global prettier options ###...

## 009. Cannot use arrow keys to choose options on Windows - 输入选项 `number` , Enter ### Reference - [eslint issues #5779](https://github.com/eslint/eslint/issues/5779)

## 010. Markdown 使用 - 首行缩进   两个 ` ` 即可 - 图片尺寸 `` ### 参考 - https://www.zhihu.com/question/21420126 - https://stackoverflow.com/questions/14675913/changing-image-size-in-markdown

## 011. Git commit log - Head - type: feat 新特性, fix 修改问题, docs 文档, style 格式, refactor 重构, test 测试用例,revert 还原, chore 其他修改, 比如构建流程, 依赖管理. - scope:影响范围, 比如: route,...

## 012. 代码片段编写 ````js import Taro, { Component } from '@tarojs/taro' import { View, Text } from '@tarojs/components' import './index.scss' export default class Index extends Component { config = {...

## 013. Ve2x base64 解密 浏览器 `F12`, 在 `console` 面板里输入 ```bash # 加密 btoa('13122223333') => MTMxMjIyMjMzMzM= # 解密 atob('Y3JhY2sybkBnbWFpbC5jb20=') => [email protected] ``` ### 参考 - https://www.v2ex.com/t/514639 - https://github.com/ttop5/issue-blog