<!-- Predestination -->
<!-- Movie page https://en.wikipedia.org/wiki/Predestination_(film) -->
JavaScript
var jane = {
id: 1, //Never changes trough the cycles, so it's always the same object
name: 'Jane',
bear: function(who){ //With who?
console.log(this);
console.log("had a child with");
this.name = "Jane"; //This becomes the newborn itself
console.log(this);
console.log("The new child is: ", this);
return this; //The Newborn
},
grow: function(){
console.log(this.name + " is growing...");
this.name = "John"; //Jane changes name and becomes John
console.log(this.name + " has grown...");
return this; //The Grown One
}
}
var john;
for(var i = 0; i < 100; i++){ //Until when..??
john = jane.grow(); //John is Jane (growth up)
jane = jane.bear(john); //Jane has a child with John, the child is Jane herself
}
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Console
Debug your Fiddle with a minimal built-in JavaScript console.