Example Analysis of function default value in ES6 version
This article mainly introduces the ES6 version of the function default value of the example analysis, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand.
The default values provided by ES6 at the syntax level are much more reliable.
Const pow = (x, yellow2) = > {let result = 1; for (let I = 0, max = y; I
< max; i++) { result *= x; } return result;}console.log(pow(2)); // =>4console.log (pow (2,3)) / / = > 8console.log (pow (2,0)); / / = > 1 Thank you for reading this article carefully. I hope the article "sample Analysis of function defaults in ES6 version" shared by the editor will be helpful to you. At the same time, I also hope you will support us, pay attention to the industry information channel, and more related knowledge is waiting for you to learn!