Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
class Lannister {
dieNext() {
const victim = [
console.log(`${} is going to kill ${victim[Math.floor(Math.random() * victim.length)]}!`);
constructor(data) { =;
this.father = data.father;
this.hairColor = data.hairColor;
let Joffrey = new Lannister({ name: 'Joffrey', father: 'Jamie' });
Joffrey.dieNext(); //Joffrey is going to kill Jamie! 😱
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment