DEV Community

Cover image for variable declaration in typeScript
Manu krishnan
Manu krishnan

Posted on

variable declaration in typeScript

let-const-var

let variableName: type
const constantName: type = value
var oldStyleVariableName: type

normal function

function functionName(params1: type, params2: type): returnType {

}

arrow function
const arrowfunction =(param1:type,param2:type):returntype=>{
}

enum
enum EnumName {
VALUE1,
VALUE2,
VALUE3,
}

any new knowedge please let me know in comment section

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay