Diff
checker
Text
Text
Images
Documents
Excel
Folders
Legal
Enterprise
Desktop
Pricing
Sign in
Download Diffchecker Desktop
Compare text
Find the difference between two text files
Tools
History
Real-time editor
Hide unchanged lines
Disable line wrap
Layout
Split
Unified
Diff precision
Smart
Word
Char
Syntax highlighting
Choose syntax
Ignore
Transform text
Go to first change
Edit input
Diffchecker Desktop
The most secure way to run Diffchecker. Get the Diffchecker Desktop app: your diffs never leave your computer!
Get Desktop
Untitled diff
Created
11 years ago
Diff never expires
Clear
Export
Share
Explain
21 removals
Lines
Total
Removed
Characters
Total
Removed
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
50 lines
Copy
46 additions
Lines
Total
Added
Characters
Total
Added
To continue using this feature, upgrade to
Diff
checker
Pro
View Pricing
48 lines
Copy
// Define variables
// Define variables
var output = document.getElementById("message");
var output = document.getElementById("message");
Copy
Copied
Copy
Copied
var movies = document.getElementById("movies");
var object = document.getElementById("object");
var BR = "<br>";
var BR = "<br>";
Copy
Copied
Copy
Copied
var makeBreakfast;
var mood;
var energyLevel;
var doWork;
var powerOn;
var command;
var duration;
var quitWork;
// Define robot object
// Define robot object
var robot = {
var robot = {
Copy
Copied
Copy
Copied
material: "titanium",
material: "titanium",
mood: "happy",
mood: "happy",
energyLevel: 100,
energyLevel: 100,
powerOn: false,
powerOn: false,
command: "Sweeping the floor",
command: "Sweeping the floor",
duration: 10,
duration: 10,
favoriteMovies: ["2001: A Space Odyssey", "The Terminator", "I, Robot",
"WALL-E", "Short Circuit", "Forbidden Planet"]
favoriteMovies: ["2001: A Space Odyssey", "The Terminator", "I, Robot",
"WALL-E", "Short Circuit", "Forbidden Planet"]
,
};
makeBreakfast:
function (newMood) {
this.
mood = newMood;
makeBreakfast =
function (newMood) {
if (
this.
mood === "Happy") {
mood = newMood;
output.innerHTML += "Here are your waffles and milk, master." + BR;
if (
mood === "Happy") {
} else {
output.innerHTML += "Here are your waffles and milk, master." + BR;
output.innerHTML += "Here is your burnt toast and lukewarm water, master." + BR;
} else {
this.
energyLevel = 50;
output.innerHTML += "Here is your burnt toast and lukewarm water, master." + BR;
}
energyLevel = 50;
},
}
doWork:
function () {
};
if (!
this.
powerOn) {
doWork =
function () {
this.
powerOn = true;
if (!
powerOn) {
output.innerHtml += "My current task is: " +
this.
command + ". Duration: " +
this.
duration + " minutes." + BR;
powerOn = true;
}
output.innerHtml += "My current task is: " +
command + ". Duration: " +
duration + " minutes." + BR;
},
}
quitWork:
function () {
};
if (
this.
powerOn) {
quitWork =
function () {
this.
energyLevel = 90;
if (
powerOn) {
this.
powerOn = false;
energyLevel = 90;
this.
command = "Taking a nap";
powerOn = false;
}
command = "Taking a nap";
}
}
};
};
// Make robot do housework
// Make robot do housework
Copy
Copied
Copy
Copied
doWork();
robot.
doWork();
quitWork();
robot.makeBreakfast('happy');
robot.
quitWork();
for(var i = 0, l = robot.favoriteMovies.length; i < l; i++) {
movies.innerHTML += robot.favoriteMovies[i] + BR;
}
object.innerHTML = JSON.stringify(robot);
Saved diffs
Original text
Open file
// Define variables var output = document.getElementById("message"); var BR = "<br>"; var makeBreakfast; var mood; var energyLevel; var doWork; var powerOn; var command; var duration; var quitWork; // Define robot object var robot = { material: "titanium", mood: "happy", energyLevel: 100, powerOn: false, command: "Sweeping the floor", duration: 10, favoriteMovies: ["2001: A Space Odyssey", "The Terminator", "I, Robot", "WALL-E", "Short Circuit", "Forbidden Planet"] }; makeBreakfast = function (newMood) { mood = newMood; if (mood === "Happy") { output.innerHTML += "Here are your waffles and milk, master." + BR; } else { output.innerHTML += "Here is your burnt toast and lukewarm water, master." + BR; energyLevel = 50; } }; doWork = function () { if (!powerOn) { powerOn = true; output.innerHtml += "My current task is: " + command + ". Duration: " + duration + " minutes." + BR; } }; quitWork = function () { if (powerOn) { energyLevel = 90; powerOn = false; command = "Taking a nap"; } }; // Make robot do housework doWork(); quitWork();
Changed text
Open file
// Define variables var output = document.getElementById("message"); var movies = document.getElementById("movies"); var object = document.getElementById("object"); var BR = "<br>"; // Define robot object var robot = { material: "titanium", mood: "happy", energyLevel: 100, powerOn: false, command: "Sweeping the floor", duration: 10, favoriteMovies: ["2001: A Space Odyssey", "The Terminator", "I, Robot", "WALL-E", "Short Circuit", "Forbidden Planet"], makeBreakfast: function (newMood) { this.mood = newMood; if (this.mood === "Happy") { output.innerHTML += "Here are your waffles and milk, master." + BR; } else { output.innerHTML += "Here is your burnt toast and lukewarm water, master." + BR; this.energyLevel = 50; } }, doWork: function () { if (!this.powerOn) { this.powerOn = true; output.innerHtml += "My current task is: " + this.command + ". Duration: " + this.duration + " minutes." + BR; } }, quitWork: function () { if (this.powerOn) { this.energyLevel = 90; this.powerOn = false; this.command = "Taking a nap"; } } }; // Make robot do housework robot.doWork(); robot.makeBreakfast('happy'); robot.quitWork(); for(var i = 0, l = robot.favoriteMovies.length; i < l; i++) { movies.innerHTML += robot.favoriteMovies[i] + BR; } object.innerHTML = JSON.stringify(robot);
Find difference