Demo entry 6399391

Test

   

Submitted by anonymous on May 24, 2017 at 17:13
Language: JavaScript+Cheetah. Code size: 442 Bytes.

var person = {
	says: function(m){
		this.message = m;	
		return this;
	},
	to: function(person) {
		if(person.constructor === Array){
			for (p in person) {
				person[p].hears(this.message).from(this);
			}
		}else {
			person.hears(this.message).from(this);
		} 		
		return this;
	},
	hears: function(m){
		this.heard = m;
		return this;
	},
	from: function(person){
		this.from_person = person;
		return this;
	}
};

This snippet took 0.01 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).