本文主要是介绍【Edabit 算法 ★☆☆☆☆☆】【分钟转秒数】Convert Minutes into Seconds,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
【Edabit 算法 ★☆☆☆☆☆】【分钟转秒数】Convert Minutes into Seconds
math
numbers
Instructions
Write a function that takes an integer minutes and converts it to seconds.
Examples
convert(5) // 300
convert(3) // 180
convert(2) // 120
Notes
- Don’t forget to return the result.
const convert = (minutes) => 60*minutes;
TestCases
let Test = (function(){return {assertEquals:function(actual,expected){if(actual !== expected){let errorMsg = `actual is ${actual},${expected} is expected`;throw new Error(errorMsg);}}}
})();
Test.assertEquals(convert(6), 360)
Test.assertEquals(convert(4), 240)
Test.assertEquals(convert(8), 480)
Test.assertEquals(convert(60), 3600)
这篇关于【Edabit 算法 ★☆☆☆☆☆】【分钟转秒数】Convert Minutes into Seconds的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!