one-day-one-puzzle
see issue
one-day-one-puzzle
one-day-one-puzzle
see issue
function types(val: any): string { return Object.prototype.toString().call(val) }
扩展,如何精确计算 加、减、乘、除
Friend:
1、ES5先构造子类实例对象this,再将父类方法添加到this上,ES6先将父类对象和方法添加到this上,再根据子类构造函数修改this
2、ES5无法继承父类原生构造函数,而ES6可以继承父类所有行为
题干描述:
Write a function named first_non_repeating_letter that takes a string input, and returns the first character that is not repeated anywhere in the string.
For example, if given the input 'stress', the function should return 't', since the letter t only occurs once in the string, and occurs first in the string.
As an added challenge, upper- and lowercase letters are considered the same character, but the function should return the correct case for the initial letter. For example, the input 'sTreSS' should return 'T'.
If a string contains all repeating characters, it should return an empty string ("") or None
Friend: new 是先新建一个 Object 对象,再用这个对象去继承目标对象的 prototype。 Object.create()
是先新建一个隐式构造函数,用它的 prototype 去继承目标对象,最后 new 一个对象
[0, -1, 1, 2, 3].some(i => {
console.log(i)
return i < 0
})
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Could you solve it without converting the integer to a string?
描述:有一家奶茶店生产 ['奶茶', '咖啡','果汁'] 三个品类,有 ['大',‘中’,’小‘] 三个尺寸,有 ['8分甜',‘5分甜’,’不甜‘] 三个糖度
列举出所有的品类,比如 5分甜的小杯奶茶
A.filter(i => !B.includes(i))
C.filter(i => D.includes(i))
题干描述:
Write a program that will calculate the number of trailing zeros in a factorial of a given number.
N! = 1 * 2 * 3 * ... * N
Examples zeros(6) = 1
# 6! = 1 * 2 * 3 * 4 * 5 * 6 = 720 --> 1 trailing zero
zeros(12) = 2
# 12! = 479001600 --> 2 trailing zeros
事件流描述的是从页面中接收事件的顺序。
“DOM2级事件”规定的事件流包括三个阶段: 事件捕获阶段、处于目标阶段和事件冒泡阶段。从最不具体的元素(document) 捕获到最具体的元素,再从最具体的元素冒泡到最不具体的元素。最后在冒泡阶段对事件进行相应。
为事件代理(委托)提供条件,即事件代理依赖事件冒泡。
event.stopPropagation()
event.preventDefault()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.