Get the App
SLTechnology News&Howtos  ›  Development  › 

Example Analysis of function default value in ES6 version

Shulou Source: shulou.com Published: 2022-06-01 04:39:32 09月22日 Update

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!

Tags: Articles functions versions examples analysis grammar value interests at the same time levels more friends knowledge editing industry information information channels channels references learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft vpn NVidia Apple Linux