Skip to content

Commit

Permalink
basic types
Browse files Browse the repository at this point in the history
  • Loading branch information
ARQUM21 committed Jul 31, 2024
1 parent 56498ec commit cb72892
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
32 changes: 32 additions & 0 deletions Basic Types/index.js
Original file line number Diff line number Diff line change
@@ -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);
42 changes: 42 additions & 0 deletions Basic Types/index.ts
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit cb72892

Please sign in to comment.