Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

6.小小恶作剧中函数两种不同变量类型的不同引用方式 #635

Open
fdy696 opened this issue Sep 24, 2017 · 1 comment
Open

Comments

@fdy696
Copy link

fdy696 commented Sep 24, 2017

<script> function cooking(foodList1){ foodList1[2] = "rich"; // console.log(foodList1); }
var foodList = ["fish", "list"];
cooking(foodList);
console.log(foodList);


	
</script>
` 执行结果:(3) ["fish", "list", "rich"] 此处foodlist为引用类型,两者相互影响
@antarts
Copy link
Contributor

antarts commented Sep 24, 2017

foodList为实参

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants