Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
231 views
in Technique[技术] by (71.8m points)

angular - What is this data structure inside the Typescript class similar to dictionary in Python

I have been searching for the name of this structure inside this Typescript class. I know it is very similar to a dictionary in python but wanted to find more details on this and why it is working this way. Is it okay to use this like this or is it best to define a separate class and use an instance of that inside myClass? Many Thanks

class myClass {

    whatAmI = {
        title: "This Title",
        age: 29,
        date:  "26/01/2021"
    }
}
  
let x = new myClass();
console.log(x.whatAmI.title);
question from:https://stackoverflow.com/questions/65909789/what-is-this-data-structure-inside-the-typescript-class-similar-to-dictionary-in

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...