# Alchemy University 学习教程,第一大块:JavaScript Basics (2) **Published by:** [andrecronje](https://paragraph.com/@nicholastse/) **Published on:** 2023-01-01 **URL:** https://paragraph.com/@nicholastse/alchemy-university-javascript-basics-2 ## Content 估值102亿融资5.45亿的Alchemy 项目,大学每周任务逐步开始。持有大学生早期卡的地址可以进入以下官网,开始大学生活: 这一期我们学习一些基本函数: 1: Get Message 查看任务要求: 这里要求我们找到字符串,字符串在test.js文件里面: 这里我们就可以输入: function getMessage() {\ return "it looks like nothing was returned from getMessage";\ } module.exports = getMessage; 2: Add Two 查看要求,需要完成加法运算: 实现每次加2: 输入: function addTwo(input) {\ return input + 2;\ } module.exports = addTwo; 3: Multiply 查看要求,需要完成两个数之间乘法运算: 输入 function product(a,b) {\ return a * b;\ } module.exports = product; 4: Average 查看要求,需要完成几个数之间的平均值运算: 输入: function average(a, b, c, d) { let e = a + b + c +d; return e / 4; } module.exports = average; 5: Random 查看要求,需要取0-1之间的随机数运算,系统默认代码就是官方给出的 Math.random(): 输入: function getRandom() { return Math.random(); } module.exports = getRandom; 6: Floor 查看要求,需要把一个数的小数点后面的数去掉: 输入: function getFloor(x) { return Math.floor(x); } module.exports = getFloor; 以上JavaScript Basics的前面的第二节完成。 未完待续...... 了解更多,请关注作者:https://twitter.com/bitc2024 ## Publication Information - [andrecronje](https://paragraph.com/@nicholastse/): Publication homepage - [All Posts](https://paragraph.com/@nicholastse/): More posts from this publication - [RSS Feed](https://api.paragraph.com/blogs/rss/@nicholastse): Subscribe to updates - [Twitter](https://twitter.com/kobe80318935): Follow on Twitter