How should you build the code segment?

You are creating a function by using JavaScript.
The function accepts an object as the parameter andreturns a string that identifies the data type of the object.
You have the following requirements:
The function must return “Number” if the object is a number
The function must return “String” if the object is a string
The function must return “Unknown” if the object isneither a number nor a string
You need to implement the function to meet the requirements.
How should you build the code segment? (To answer, drag the appropriate word to the correct location in the
code segment. Each word may be used once, more thanonce, or not at all.)
You may need to drag the split bar between panes orscroll to view content.)

You are creating a function by using JavaScript.
The function accepts an object as the parameter andreturns a string that identifies the data type of the object.
You have the following requirements:
The function must return “Number” if the object is a number
The function must return “String” if the object is a string
The function must return “Unknown” if the object isneither a number nor a string
You need to implement the function to meet the requirements.
How should you build the code segment? (To answer, drag the appropriate word to the correct location in the
code segment. Each word may be used once, more thanonce, or not at all.)
You may need to drag the split bar between panes orscroll to view content.)

Answer:

Explanation:



Leave a Reply 0

Your email address will not be published. Required fields are marked *