js 链式调用的实现原理

var doudou = {
	makeup: function () {
		console.log('I am beautiful!');
		return this;
	},
	eat: function () {
		console.log('I am strongger!');
		return this;
	},
	exercise: function () {
		console.log('I am younger!');
		return this;
	},
};
doudou.makeup().eat().exercise();
发布了53 篇原创文章 · 获赞 12 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/bingqise5193/article/details/100096995