js-對象學習內容

js 對象的連續調用this

var chloe = {
	height: function() {
		console.log("Well, currently, I am only 165cm in stature.");
		return this;
	},

	smoke: function() {
		console.log ('NOT A SMOKER.');
		return this;
	},

	drink: function() {
		console.log('I want Whisky on the rocks!');
		return this;
	}
}
  chloe.height().smoke().drink();
相關文章
相關標籤/搜索