With an array that is mostly boolean, write a function that will return the first string.
For example, if we have the following array:
var things = [
true, true, true, false,
true, true, 1, true,
true, false, true, false,
true, 'hello', false, true,
true, true, true, true,
false, false, 'world', true
];The correct answer would be hello.
For example, if we have the following array:
var words = ['hi', 'hello', 'carrot', 'world'];The correct answer would be ['world', 'hi', 'hello', 'carrot'].
For example, if we have the following array:
var words = ['hi', 'hello', 'car', 'cool', 'blah'];The correct answer would be ['car', 'blah'].
For example, if we have the following array:
var pizzas = [
{ crust: 'deep dish' },
{ crust: 'pan' },
{ crust: 'thin' },
];The correct answer would be ['deep dish', 'pan', 'thin'].