Comments (1)
function createArray(arr = []) {
// Get a random between 2 and 32
const randomNum = 2 + Math.floor(Math.random()*31)
// Cannot be repeated with the number in arr
!arr.includes(randomNum) && arr.push(randomNum)
// Create a array of length 5
arr.length < 5 && createArray(arr)
return arr
}
from blog.
Related Issues (20)
- web-api
- 浏览器相关
- 算法相关
- React HOT 37
- Code Snippet HOT 2
- Q&A HOT 1
- what is different between combination and permutation?
- meta 标签的理解
- 页面导入样式 Link 和 @import 的区别
- 圣杯,双飞翼布局
- House robber HOT 1
- 纯CSS实现三角形 HOT 1
- 《数学之美》 HOT 1
- 任务 vs 微任务
- ++i 与 i++ 的区别? HOT 1
- 《图解算法》 HOT 2
- this
- 原型和原型链
- 《Composing SoftWare》 HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from blog.