From cb72892a16dbfce72435c66d743e0d019e5c3908 Mon Sep 17 00:00:00 2001 From: ARQUM21 Date: Wed, 31 Jul 2024 16:16:46 -0700 Subject: [PATCH] basic types --- Basic Types/index.js | 32 ++++++++++++++++++++++++++++++++ Basic Types/index.ts | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 Basic Types/index.js create mode 100644 Basic Types/index.ts diff --git a/Basic Types/index.js b/Basic Types/index.js new file mode 100644 index 0000000..0d514a4 --- /dev/null +++ b/Basic Types/index.js @@ -0,0 +1,32 @@ +// let userName: string = "Arqum"; +// let userAge: number = 21; +// let userFavDishes: string[] = ["briyani"]; +// let userIsMarried: boolean = false; +// console.log("userAge=>",userAge); +// console.log("userName=>", userName); + + +// interface user{ +// firstName: string; +// lastName: string; +// age: number | string; +// cnic?: number; +// subject: string[]; +// favNumber: number[]; +// } +// const user : user ={ +// firstName: "arqum", +// lastName: "tariq", +// age: "21", +// subject: ["english", "urdu"], +// favNumber: [21, 22], +// } +function greet(name) { + console.log("hello, ".concat(name)); +} +greet("heloo0 Arqum"); +function welcome(name) { + return "hello ".concat(name); +} +var msg = welcome("M.Arqum"); +console.log(msg); diff --git a/Basic Types/index.ts b/Basic Types/index.ts new file mode 100644 index 0000000..58a3c44 --- /dev/null +++ b/Basic Types/index.ts @@ -0,0 +1,42 @@ +// let userName: string = "Arqum"; +// let userAge: number = 21; +// let userFavDishes: string[] = ["briyani"]; +// let userIsMarried: boolean = false; +// console.log("userAge=>",userAge); +// console.log("userName=>", userName); + + +// interface user{ +// firstName: string; +// lastName: string; +// age: number | string; +// cnic?: number; +// subject: string[]; +// favNumber: number[]; +// } + +// const user : user ={ +// firstName: "arqum", +// lastName: "tariq", +// age: "21", +// subject: ["english", "urdu"], +// favNumber: [21, 22], +// } + + +function greet( name: string){ + console.log(`hello, ${name}`) + +} + +greet("heloo0 Arqum"); + + +function welcome(name:string): string{ + return `hello ${name}` +} + +const msg : string = welcome("M.Arqum"); + +console.log(msg); +