Skip to content

Instantly share code, notes, and snippets.

@speckworks
Created June 17, 2020 20:06
Show Gist options
  • Save speckworks/8fce75ccf1307e5010a8a5faca7d30ee to your computer and use it in GitHub Desktop.
Save speckworks/8fce75ccf1307e5010a8a5faca7d30ee to your computer and use it in GitHub Desktop.
let your_drink = "coffee";
const reverse = (s) => {
return s.split("").reverse().join("");
}
const barista = {
str1: "ion",
str2: reverse("rcne"),
str3: "ypt",
request: function(preference){
return preference + "secret word:"
+this.str2 + this.str3 + this.str1;
}
}
barista.request(your_drink);
//outputs: coffee secret word:encryption
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment