Skip to content

Commit

Permalink
Update test.tsx
Browse files Browse the repository at this point in the history
  • Loading branch information
ambujbpl authored Nov 2, 2024
1 parent 1fb87f3 commit ffae194
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ad/test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,17 @@ pay1 = new Payment("Ambuj",10000,"test amount");
inv1 = new Invoice("Amb",11000,"test amount for amb");
console.log(pay1.formate())

// -----------------------------------------------------------------------------------------------------
// Generic Types
const getUID = <Type extends object>(obj:Type) => {
let uid = Math.floor(Math.random() * 100)
return {...obj , uid}
}
const user = getUID({name:'Ambuj',age:15})
console.log(user);

// -----------------------------------------------------------------------------------------------------

let a = 1;
let b = ++a;// check with pre and post increement
console.log(`a : ${a} & b : ${b}`)
Expand Down

0 comments on commit ffae194

Please sign in to comment.