bradxr
8/4/2018 - 3:41 PM

Use export to Reuse a Code Block

const capitalizeString = (string) => {
  return string.charAt(0).toUpperCase() + string.slice(1);
}

export { capitalizeString };    // how to export functions
export const foo = "bar";   // how to export variables

// compact all export statements into one line
export { capitalizeString, foo };