码迷,mamicode.com
首页 > 其他好文 > 详细

函数分析题

时间:2018-12-02 20:40:14      阅读:217      评论:0      收藏:0      [点我收藏+]

标签:return   log   function   函数   fun   分析   on()   str   ons   

1.
var a = 12
function fn() {  
console.log(a) 
  var a = 45;  
console.log(a)  
}
fn()
2.
function fn() {  
console.log(11)  
function ff() {    
console.log(22)  
}  
ff()
}
fn()
3.
function fn() { 
console.log(5)   fn()  
}
fn()
4.
var a = 123;

function fun() {
alert(a);
}
fun();
5.
var a = 123;

function fun() {
alert(a);
var a = 456;
}
fun();
alert(a);
6.
var a = 123;

function fun(a) {
alert(a);
a = 456;
}
fun();
alert(a);
7.
var a = 123;

function fun(a) {
alert(a);
a = 456;
}
fun(123);
alert(a);
8.
function test(a, b) {
console.log(a);
console.log(b);
var b = 234;
console.log(b);
a = 123;
console.log(a);

function a() {}
var a;
b = 234;
var b = function() {}
console.log(a);
console.log(b);
}
test(1);
9.
function fn(a) {
console.log(a);
var a = 123;
console.log(a);

function a() {}
console.log(a);
var b = function() {}
console.log(b);

function d() {}
}
fn(1);
10.
function fn() {  
console.log(12)
}
var as = fn() console.log(as) 11.
function fn() {  
console.log(12)   return 45;  
console.log(456)  
}
12.
var a = 12; 
function fn() {  
console.log(a)   return 4;  
var a = 45;
}
13.
var a = 100; 
function testResult() {  
var b = 2 * a  
var a = 200  
var c = a / 2   alert(b)   alert(c)
}
testResult()

函数分析题

标签:return   log   function   函数   fun   分析   on()   str   ons   

原文地址:https://www.cnblogs.com/zzz035921/p/10055007.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!