Skip to content

Instantly share code, notes, and snippets.

@kdabir
Last active August 19, 2016 08:03
Show Gist options
  • Save kdabir/8629b06eb6c30ae4d74e244c56d6bc28 to your computer and use it in GitHub Desktop.
Save kdabir/8629b06eb6c30ae4d74e244c56d6bc28 to your computer and use it in GitHub Desktop.
Use at least one of following - a semicolon to terminate expression or an explicit return keyword.
// In a function foo be careful when you have something like following:
// Doesn't Work - implicit return and no semicolon
const myStr = "hello-world".split('-').join('_')
`${myStr}/`
// Works
const myStr = "hello-world".split('-').join('_');
return `${myStr}/`;
// works
const myStr = "hello-world".split('-').join('_');
`${myStr}/`;
// works
const myStr = "hello-world".split('-').join('_')
return `${myStr}/`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment