Skip to content

feature: default value for string parameter #7447

@jjangga0214

Description

@jjangga0214
export async function main(
  a: number = 3,
  b: string = "hi"
) {
  // ...
}

In this case, a would be 3 when a user does not input from UI.

However, b will be "" (empty string), not "hi", when a user does not input from UI.

IMHO, respecting a default value will be suitable for 99% cases.

What do you think?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions