Question: please provide all correct code. Add all the parts it ask for . Do not edit the characters array. The type or interface you create

please provide all correct code. Add all the parts it ask for . Do not edit the characters array. The type or interface you create will be checked independently against different code.
// 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: [7,8,9],
lightsaberColor: [ 'blue', 'orange' ]
},
{
name: 'Luke Skywalker',
faction: [ 'Jedi', 'Rebellion' ],
episodeAppearances: [3,4,5,6,7,8,9],
lightsaberColor: [ 'blue', 'green' ]
},
{
name: 'Kylo Ren',
faction: [ 'Knights of Ren', 'First Order', 'Jedi' ],
episodeAppearances: [7,8,9],
lightsaberColor: [ 'red' ]
},
{
name: 'FN2187(Finn)',
faction: [ 'Resistance', 'First Order' ],
episodeAppearances: [7,8,9]
},
{
name: 'Poe Dameron',
faction: [ 'Resistance', 'New Republic' ],
episodeAppearances: [7,8,9]
},
{
name: 'Darth Vader',
faction: [ 'Sith', 'Jedi', 'Republic', 'Empire' ],
episodeAppearances: [1,2,3,4,5,6],
lightsaberColor: [ 'blue', 'red' ]
},
{
name: 'Han Solo',
faction: 'Rebellion',
episodeAppearances: [4,5,6,7,9]
},
{
name: 'Leia Organa',
faction: 'Rebellion',
episodeAppearances: [3,4,5,6,7,8,9],
lightsaberColor: [ 'blue' ]
}
]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!