Question: WRITE IN JAVASCRIPT CAN NOT USE ANY EXTERNAL FILES OR LIBRARIES FILE MUST BE CONFIGURED FOR STRICT MODE MUST BE ORIGINAL WORK PLEASE function _strNumbers(

WRITE IN JAVASCRIPT

CAN NOT USE ANY EXTERNAL FILES OR LIBRARIES

FILE MUST BE CONFIGURED FOR STRICT MODE

MUST BE ORIGINAL WORK PLEASE

function _strNumbers( array )

Create a JavaScript function that meets the following requirements:

Receives an array of strings (source array)

Some of the strings in the source array have numbers, some do not

The strings in the array vary in length

Returns a new array that contains the strings, from the source array, that contained numbers in them.

If there are no strings in the source array, then the function returns and empty array If there are strings in the source array, but none of them contain numbers, then the function returns an empty array to the caller.

EXAMPLE

numInStr(["1a", "a", "2b", "b"]) ["1a", "2b"]

numInStr(["abc", "abc10"]) ["abc10"]

numInStr(["abc", "ab10c", "a10bc", "bcd"]) ["ab10c", "a10bc"]

numInStr(["this is a test", "test1"]) ["test1"]

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!