Skip to content

Instantly share code, notes, and snippets.

@flavioribeirojr
Created December 16, 2018 19:54
Show Gist options
  • Save flavioribeirojr/0c2886a3a8e0a2bba1a8ff538cadb465 to your computer and use it in GitHub Desktop.
Save flavioribeirojr/0c2886a3a8e0a2bba1a8ff538cadb465 to your computer and use it in GitHub Desktop.
function createDriver(name) {
return {
drive: function () {
console.log(`${name} is driving...`)
}
}
}
var vanDriver = createDriver('Rogerinho')
vanDriver.drive() // Rogerinho is driving...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment