js面向对象学习总结

Posted 还能再菜点吗?

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了js面向对象学习总结相关的知识,希望对你有一定的参考价值。

1.函数作为参数进行传递

function a(str,fun){
	 console.log(fun(str))
};

function up(str){
    return str.toUpperCase();
};
function down(str){
    return str.toLowerCase();
};

a(‘Hello,World !‘,up) //HELLO,WORLD !
a(‘Hello,World !‘,down) //hello,world !

  

以上是关于js面向对象学习总结的主要内容,如果未能解决你的问题,请参考以下文章