Nothing changes from our first variant types, but we will add the webapp record type definition to them, as follows:
type internetCompany = [ `Facebook(string) | `Google(string) | `Twitter(string) ];
type platformCompany = [ internetCompany | `Amazon(string) | `Uber(string) ];
type webapp = {
name: string,
url: string,
};
Then, we can input some data for the rest of the program, using that record type, as follows:
/* some data */
let facebook: webapp = {
name: "facebook",
url: "https://facebook.com",
}
let facebookads: webapp = {
name: "facebook ads",
url: "https://www.facebook.com/business",
}
let messenger: webapp = {
name: "messenger",
url: "https://www.facebook.com/messenger",
}
let instagram: webapp = {
name: "instagram",
url: "https://www.instagram.com",
}
Note that we...