Blogger Information
Blog 7
fans 0
comment 0
visits 4644
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
独孤九贱 JavaScript 笔记(七) —— 函数和函数表达式
残羽的博客
Original
579 people have browsed it

函数定义

function sayHello(word){
    document.write(word + '欢迎你');
} 
sayHello('www.php.cn');


变量作用域

在函数外的变量定义,可以在当前脚本中的函数内直接调用。

在函数内的变量定义,属于局部变量,可以在函数内调用,在函数外无法调用。

带有 var 定义的变量,都属于局部变量。

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments