
I need profissional javascript programmer
- or -
Post a project like this2013
$
- Posted:
- Proposals: 9
- Remote
- #2716735
- Awarded
Web Developer| Desktop Application , C# ,JAVA | C,C++ | Database Designer and developer |
Full Stack Developer/React.JS/Node.JS/ReactNative/Hybrid Apps /PHP/Wordpress/Shopify/Laravel/WebRTC/Angular/Digital Marketing
24495212359825875137240943927441383192106240118313583763063621





Description
Experience Level: Entry
Hi, i would like to write a code to achieve the below:
1. Write a function named createStatue that expects to receive three arguments:
name, location, and heightInMeters. This function should return an object. The
object it returns should have properties that are also named name, location,
and heightInMeters. The values assigned to these properties should be the values
that are passed to the function. Additionally, the object that createStatue
returns should have two methods:
isTallerThan - a function that accepts one statue object as an argument and
returns true if the height of the statue object the function belongs to
is greater than the height of the statue that is passed as an argument.
logHeight - a function that logs to the console a sentence that contains
the values of the statues's name and heightInMeters properties: "The
height of [name] is [height] meters." For example, if the statue were
Winged Victory, then the sentence that logHeight logs would be "The
height of Winged Victory is 2.44 meters."
2. Create a variable named statues and assign to it an array. This array
should contain six objects that are created by calling the createStatue
function. The values you should pass to the createStatue function to create
these objects are:
name | location | heightInMeters
-----------------------------------------------------
Statue of Liberty | New York | 46
| |
Christ the Redeemer | Rio de Janeiro | 30
| |
David | Florence | 5.17
| |
Little Mermaid | Copenhagen | 1.25
| |
Winged Victory | Paris | 2.44
| |
Venus de Milo | Paris | 2
3. Write the following three functions. All three should use the statues array
to determine what to return.
getStatueByName - this function expects a string as an argument and
returns the object in the statues array whose name property is equal
to the string that is passed to it (if there is one).
getStatuesByLocation - this function expects a string as an argument
and returns an array containing the objects in the statues array
whose location properties are equal to the string that is passed to it.
getAverageHeight - this function returns the average height of all the
statues in the array.
1. Write a function named createStatue that expects to receive three arguments:
name, location, and heightInMeters. This function should return an object. The
object it returns should have properties that are also named name, location,
and heightInMeters. The values assigned to these properties should be the values
that are passed to the function. Additionally, the object that createStatue
returns should have two methods:
isTallerThan - a function that accepts one statue object as an argument and
returns true if the height of the statue object the function belongs to
is greater than the height of the statue that is passed as an argument.
logHeight - a function that logs to the console a sentence that contains
the values of the statues's name and heightInMeters properties: "The
height of [name] is [height] meters." For example, if the statue were
Winged Victory, then the sentence that logHeight logs would be "The
height of Winged Victory is 2.44 meters."
2. Create a variable named statues and assign to it an array. This array
should contain six objects that are created by calling the createStatue
function. The values you should pass to the createStatue function to create
these objects are:
name | location | heightInMeters
-----------------------------------------------------
Statue of Liberty | New York | 46
| |
Christ the Redeemer | Rio de Janeiro | 30
| |
David | Florence | 5.17
| |
Little Mermaid | Copenhagen | 1.25
| |
Winged Victory | Paris | 2.44
| |
Venus de Milo | Paris | 2
3. Write the following three functions. All three should use the statues array
to determine what to return.
getStatueByName - this function expects a string as an argument and
returns the object in the statues array whose name property is equal
to the string that is passed to it (if there is one).
getStatuesByLocation - this function expects a string as an argument
and returns an array containing the objects in the statues array
whose location properties are equal to the string that is passed to it.
getAverageHeight - this function returns the average height of all the
statues in the array.

Murad R.
100% (2)Projects Completed
2
Freelancers worked with
2
Projects awarded
100%
Last project
6 Mar 2020
Germany
New Proposal
Login to your account and send a proposal now to get this project.
Log inClarification Board Ask a Question
-
There are no clarification messages.
We collect cookies to enable the proper functioning and security of our website, and to enhance your experience. By clicking on 'Accept All Cookies', you consent to the use of these cookies. You can change your 'Cookies Settings' at any time. For more information, please read ourCookie Policy
Cookie Settings
Accept All Cookies