
JavaScript
弥玥
这个作者很懒,什么都没留下…
展开
-
codewars第五篇(7kyu)Vowel Count
题目:Return the number (count) of vowels in the given string.We will consider a, e, i, o, and u as vowels for this Kata.The input string will only consist of lower case letters and/or spaces.个人感觉较好的...原创 2019-12-20 15:56:56 · 384 阅读 · 0 评论 -
codewars第四篇(8kyu)Is your period late?
题目:In this kata, we will make a function to test whether a period is late.Our function will take three parameters:last - The Date object with the date of the last periodtoday - The Date object wit...原创 2019-12-20 10:25:00 · 781 阅读 · 0 评论 -
codewars第三篇(8kyu)Well of Ideas - Easy Version
题目:For every good kata idea there seem to be quite a few bad ones!In this kata you need to check the provided array (x) for good ideas ‘good’ and bad ideas ‘bad’. If there are one or two good ideas,...原创 2019-12-19 14:58:37 · 537 阅读 · 0 评论 -
codewars第二篇(8kyu)Remove String Spaces
题目:Simple, remove the spaces from the string, then return the resultant string.个人感觉不错的解答:function noSpace(x){ return x.replace(/\s/g, '');}function noSpace(x){return x.split(' ').join('')}co...原创 2019-12-19 14:15:04 · 344 阅读 · 0 评论 -
codewars第一篇(8kyu)Generate range of integers
题目:Implement a function named generateRange(min, max, step), which takes three arguments and generates a range of integers from min to max, with the step. The first integer is the minimum value, the ...原创 2019-12-19 11:19:36 · 356 阅读 · 0 评论 -
let和const
https://www.cnblogs.com/chenjg/p/7158248.html转载 2019-11-26 09:47:58 · 97 阅读 · 0 评论 -
JavaScript 正则表达式
在正则表达式中,当你在表达式加入问号时,就意味着这个表达式是可选的。<Route path="/posts/:year?/:month?" component={Posts} />原创 2019-09-10 09:09:39 · 104 阅读 · 0 评论 -
2019-09-04JavaScript类真值与类假值
类假值(Falsy):undefined、null、’’、false、0、NaN类真值(Truthy):所有不是类假值的值false || 1 || 2:1(运算从第一个参数开始,只要遇到它第一个类真值,它就返回,即短路(就近原则))使用位元或‘|’运算符可以添加权限,使用位元与‘&’运算符可以检测是否有某个权限当js编译器处理一个布尔表达式时:它先看第一个值...原创 2019-09-04 16:23:50 · 272 阅读 · 0 评论 -
Javascript 方法重写
原创 2019-09-03 16:03:16 · 486 阅读 · 0 评论 -
2019-09-03 JavaScript继承
在使用es6中extends继承时,如果在父类中有一个构造器,然后在子类中又想添加一个构造器,在子类中的构造器必须先调用父类的构造器,以创建一个父类的实例。在子类构造器中,我们可以使用super关键字去引用父类实例...原创 2019-09-03 15:57:58 · 103 阅读 · 0 评论 -
2019-09-03 JavaScript (OOP) ES6 getter & setter
const _radius = new WeakMap();class Circle { constructor(radius) { _radius.set(this, radius); } get radius() { return _radius.get(this); } set radius(value) { ...原创 2019-09-03 15:45:46 · 94 阅读 · 0 评论