Menu

Instructions Return Second Starship S Name Starships Property Length 0 Return None Functio Q43815928

* @instructions

* Return second starship’s name from `starships` property.

* If length is 0. Return ‘none’

*/

function getSecondStarshipName(character) {

// TODO: Add your code here.

return

}

/**

* ### Challenge `getSummary`

* MVP Challenge

*

* @instructions

* Combine specified field values and return them in thefollowing string format:

* Template: `{name}, {height}cm, {mass}kg. Featured in {filmcount} films.`

* Result: `Luke Skywalker, 172cm, 77kg. Featured in 5films.`

*/

function getSummary(character) {

// TODO: Add your code here

return `${“Luke Skywalker”} ${172}cm, ${77}kg. Featured in ${5}films.}`

}

/**

* ### Challenge `getVehiclesCostInCreditsSumTotal`

* MVP Challenge

*

* @instructions

* Sum the total cost in credits for all vehicles defined on theinput character.

* Sample data expected output: 8000

*/

function getVehiclesCostInCreditsSumTotal(character) {

// TODO: Add your code here.

}

/**

* ### Challenge `getStarshipPassengerAndCrewSumTotal`

* MVP Challenge

*

* @instructions

* Sum the number of crew and passenger spots for all starshipsdefined on the

* input character.

*

* Sample data expected output: 27

*/

function getStarshipPassengerAndCrewSumTotal(character) {

// TODO: Add your code here.

}

/**

* ### Challenge `getNthFilm`

* MVP Challenge

*

* @instructions

* Return the Nth `films` value (in this case title).

* Rules: filmNumber starts at 1 and refers to the *first* film,and includes only the range 1-3.

* Any numbers outside that range should throw an error.

* The Error must mention the name of your favorite _extracheesy_ movie.

*

* Given film #1, expected output: `A New Hope`

* Given film #7, expected error: `There are only 3 Star Warsmovies. Flan fiction excluded.`

*/

function getNthFilm(character, filmNumber) {

// TODO: Add your code here.

}

/**

* ### Challenge `getCargoCapacityTotal`

* Stretch Goal

*

* @instructions

* Sum the total cargo capacity for *all* vehicles andstarships.

* Some objects may not have a value for their cargocapacity.

*

* Sample data expected output: 80124

*/

function getCargoCapacityTotal(character) {

// TODO: Add your code here.

}

/**

* ### Challenge `getFastestStarshipName`

* Stretch Goal

*

* @instructions

* Find the fastest starship (by atmospheric speed.)

* Determine the correct field to compare, and return the name ofthe fastest.

* If the character does not have any starships, then return’none’.

*

* Sample data expected output: `X-wing`

*/

function getFastestStarshipName(character) {

// TODO: Add your code here.

}

/**

* ### Challenge `getLargestCargoStarshipModelName`

* Stretch Goal

*

* @instructions

* Determine the starship with the largest cargo capacity.

* Return it’s **_model_** property.

* If the character does not have any starships, then return’none’.

*

* Sample data expected output: `Lambda-class T-4a shuttle`

*/

function getLargestCargoStarshipModelName(character) {

// TODO: Add your code here.

}

/**

* ### Challenge `getSlowestVehicleOrStarshipName`

*Stretch Goal

*

* @instructions

* Find the slowest transport (including vehicles andstarships)

* based on `max_atmosphering_speed`, and return its name.

* If the character does not have any starships or vehicles, thenreturn string ‘none’.

*

*/

function getSlowestVehicleOrStarshipName(character) {

// TODO: Add your code here.

}

JavaScrirt functions:

JavaScript   

* ### Challenge `getSecondStarshipName`

* MVP Challenge

*

* @instructions

* Return second starship’s name from `starships` property.

* If length is 0. Return ‘none’

*/

function getSecondStarshipName(character) {

// TODO: Add your code here.

return

}

/**

* ### Challenge `getSummary`

* MVP Challenge

*

* @instructions

* Combine specified field values and return them in thefollowing string format:

* Template: `{name}, {height}cm, {mass}kg. Featured in {filmcount} films.`

* Result: `Luke Skywalker, 172cm, 77kg. Featured in 5films.`

*/

function getSummary(character) {

// TODO: Add your code here

return

}

/**

* ### Challenge `getVehiclesCostInCreditsSumTotal`

* MVP Challenge

*

* @instructions

* Sum the total cost in credits for all vehicles defined on theinput character.

* Sample data expected output: 8000

*/

function getVehiclesCostInCreditsSumTotal(character) {

// TODO: Add your code here.

}

/**

* ### Challenge `getStarshipPassengerAndCrewSumTotal`

* MVP Challenge

*

* @instructions

* Sum the number of crew and passenger spots for all starshipsdefined on the

* input character.

*

* Sample data expected output: 27

*/

function getStarshipPassengerAndCrewSumTotal(character) {

// TODO: Add your code here.

}

/**

* ### Challenge `getNthFilm`

* MVP Challenge

*

* @instructions

* Return the Nth `films` value (in this case title).

* Rules: filmNumber starts at 1 and refers to the *first* film,and includes only the range 1-3.

* Any numbers outside that range should throw an error.

* The Error must mention the name of your favorite _extracheesy_ movie.

*

* Given film #1, expected output: `A New Hope`

* Given film #7, expected error: `There are only 3 Star Warsmovies. Flan fiction excluded.`

*/

function getNthFilm(character, filmNumber) {

// TODO: Add your code here.

}

/**

* ### Challenge `getCargoCapacityTotal`

* Stretch Goal

*

* @instructions

* Sum the total cargo capacity for *all* vehicles andstarships.

* Some objects may not have a value for their cargocapacity.

*

* Sample data expected output: 80124

*/

function getCargoCapacityTotal(character) {

// TODO: Add your code here.

}

/**

* ### Challenge `getFastestStarshipName`

* Stretch Goal

*

* @instructions

* Find the fastest starship (by atmospheric speed.)

* Determine the correct field to compare, and return the name ofthe fastest.

* If the character does not have any starships, then return’none’.

*

* Sample data expected output: `X-wing`

*/

function getFastestStarshipName(character) {

// TODO: Add your code here.

}

/**

* ### Challenge `getLargestCargoStarshipModelName`

* Stretch Goal

*

* @instructions

* Determine the starship with the largest cargo capacity.

* Return it’s **_model_** property.

* If the character does not have any starships, then return’none’.

*

* Sample data expected output: `Lambda-class T-4a shuttle`

*/

function getLargestCargoStarshipModelName(character) {

// TODO: Add your code here.

}

/**

* ### Challenge `getSlowestVehicleOrStarshipName`

*Stretch Goal

*

* @instructions

* Find the slowest transport (including vehicles andstarships)

* based on `max_atmosphering_speed`, and return its name.

* If the character does not have any starships or vehicles, thenreturn string ‘none’.

*

*/

function getSlowestVehicleOrStarshipName(character) {

// TODO: Add your code here.

}

Expert Answer


Answer to * @instructions * Return second starship’s name from `starships` property. * If length is 0. Return ‘none’ */ function g…

OR