Get the App
SLTechnology News&Howtos  ›  Development  › 

How to declare variables with the keyword function in es6

Shulou Source: shulou.com Published: 2022-06-01 03:10:01 09月22日 Update

This article mainly introduces how to use the keyword function to declare variables in es6, which has a certain reference value, and interested friends can refer to it. I hope you can learn a lot after reading this article.

Declare variables with the keyword function

Function add (a) {var sum = a + 1; return sum;}

A new variable named add is declared and assigned a function definition

The content between {} is assigned to add

The code inside the function is not executed, but is stored in variables for future use

Thank you for reading this article carefully. I hope the article "how to declare variables with the keyword function in es6" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!

Tags: Variables articles keywords functions assignments between code value interests content just at the same time more friends knowledge editing industry information information channels Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Shulou Information Shulou Technology Apple Huawei