Question: / / Create an object type or interface for the following 'characters' array / * RULES: Do not alter the character list name can be
Create an object type or interface for the following 'characters' array
RULES:
Do not alter the character list
"name" can be any string since they are all unique
"faction" should only allow certain values Jedi Resistance, etc
"lightsaberColor" should only allow certain values blue green, etc
Not every character has "lightsaberColor"
"faction" may be a single string or an array See Han Solo
No criticism of the Disney trilogy except for Last Jedi
const characters
name: 'Rey',
faction: 'Jedi', 'Resistance'
episodeAppearances:
lightsaberColor: 'blue', 'orange'
name: 'Luke Skywalker',
faction: 'Jedi', 'Rebellion'
episodeAppearances:
lightsaberColor: 'blue', 'green'
name: 'Kylo Ren',
faction: 'Knights of Ren', 'First Order', 'Jedi'
episodeAppearances:
lightsaberColor: 'red'
name: FNFinn
faction: 'Resistance', 'First Order'
episodeAppearances:
name: 'Poe Dameron',
faction: 'Resistance', 'New Republic'
episodeAppearances:
name: 'Darth Vader',
faction: 'Sith', 'Jedi', 'Republic', 'Empire'
episodeAppearances:
lightsaberColor: 'blue', 'red'
name: 'Han Solo',
faction: 'Rebellion',
episodeAppearances:
name: 'Leia Organa',
faction: 'Rebellion',
episodeAppearances:
lightsaberColor: 'blue'
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
