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)