Diff
checker
Texte
Texte
Images
Documents
Excel
Dossiers
Legal
Enterprise
Application de bureau
Prix
Se connecter
Télécharger Diffchecker Desktop
Comparer le texte
Trouver la différence entre deux fichiers texte
Outils
Historique
Éditeur live
Cacher identiques
Sans retour à la ligne
Vue
Divisé
Unifié
Niveau de précision
Intelligent
Mot
Caractère
Coloration syntaxique
Choisir la syntaxe
Ignorer
Transformer le texte
Aller au premier écart
Modifier l'entrée
Diffchecker Desktop
La façon la plus sécurisée d'utiliser Diffchecker. Obtenez l'application Diffchecker Desktop : vos diffs ne quittent jamais votre ordinateur !
Obtenir Desktop
Untitled diff
Créé
il y a 11 ans
Le diff n'expire jamais
Effacer
Exporter
Partager
Expliquer
21 suppressions
Lignes
Total
Supprimé
Caractères
Total
Supprimé
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
50 lignes
Copier tout
46 ajouts
Lignes
Total
Ajouté
Caractères
Total
Ajouté
Pour continuer à utiliser cette fonctionnalité, passez à
Diff
checker
Pro
Voir les prix
48 lignes
Copier tout
// Define variables
// Define variables
var output = document.getElementById("message");
var output = document.getElementById("message");
Copier
Copié
Copier
Copié
var movies = document.getElementById("movies");
var object = document.getElementById("object");
var BR = "<br>";
var BR = "<br>";
Copier
Copié
Copier
Copié
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 = {
Copier
Copié
Copier
Copié
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
Copier
Copié
Copier
Copié
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);
Différences enregistrées
Texte d'origine
Ouvrir un fichier
// 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();
Texte modifié
Ouvrir un fichier
// 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);
Trouver la différence