郭奇靂
郭奇靂

Reputation: 71

difference between these two function

for(let i:number = 0 ;i<n;i++){
let sectionLine : any = sectionList[i];>>>>1
let sectionLine : SectionLine ={...sectionList[i]};>>>>2

what is the difference between 1 and 2? is let it as any or SectionLine influence the efficiency of the program?

Upvotes: 0

Views: 52

Answers (1)

Ossaija Thankgod
Ossaija Thankgod

Reputation: 454

Efficiency no, Any and SectionLine as used in your code sample is to ensure that the type of values assigned to the variables you are defining are of the right type eg any and SectionLine. It is not an ionic thing par say but typescript to provides static typing.

Upvotes: 1

Related Questions