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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started