Home >Web Front-end >JS Tutorial >How to define functions in javascript_javascript skills

How to define functions in javascript_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:14:171007browse

The following is the sample code for various methods

Copy the code The code is as follows:








The running result is:
Call the general method:
------------------ -------------------------------------------------- ------------
Call the constructor method: add1(5,6)
11
----------------- -------------------------------------------------- -------------
Call function direct measurement method: result(3,4)
7
Call function direct measurement method: result2(3)
6
------------------------------------------------ --------------------------------
Function used as data
(2 3) (4*5 )=25
-------------------------------------------------- ------------------------------------
hello world
100
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn