Effect CommunityEC
Effect Community3y ago
32 replies
hinogi

Comparison of Function Expressions and Function Declarations in TypeScript

is there only the possibility to use function expressions or is there also a possibility to use function declaration?
import { Effect } from "effect"
 
// expression
const program = Effect.sync(() => {
  console.log("Hello, World!") // side effect
  return 42 // return value
})

// declaration?
function program() {
  return Effect.sync(() => {
    console.log("Hello, World!") // side effect
    return 42 // return value
  })
}
Was this page helpful?