Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* FUNCTION DEFINING AREA */
- function logHello(){
- //console log Hello
- }
- function logMessage( ){
- //receive parameter of a message, and console log it
- //in your console log, include a label that says "Log Message:"
- }
- function returnMessage( ){
- //receive parameter and return it
- }
- function convertToPixels( ){
- //take in parameter of a number and return that number formatted as pixels
- //ex: 6 -> 6px
- }
- function enjoyTheSilence( ){
- //takes in a single parameter of a string
- //return undefined from the function
- //console log the string parameter, with the label "Here is your parameter:"
- }
- function multiplyNumbers( ){
- //take in two parameters, num1 and num2, and return their multiplication product
- }
- function squareNumber( ){
- //takes in a single parameter of a number and returns the square of that number
- //YOU MUST USE YOUR multiplyNumbers FUNCTION THAT YOU CREATED ABOVE
- }
- function buildPerson( ){
- //takes in three parameters: a name, an age, and favorite food
- //place each of these parameters in an object with a key of name, age, and favFood
- //return the object
- }
- function buildList( ){
- //receives three parameters of an unknown type and creates an array that contains those three values
- //return the array you created with those values
- //EXTRA HARD CHALLENGE:
- //make a version of this function that can receive any number of parameters and successfully add all of them to an array
- }
- function addToList( ){
- //receives two parameters: an array and a parameter of an unknown type
- //adds the second parameter into the first parameter's array
- //return the array
- }
- /* CHALLENGE MODE EXERCISES -- YOU ARE NOT EXPECTED TO BE ABLE TO COMPLETE THESE IMMEDIATELY */
- /* TESTING THESE IS UP TO YOU */
- /* HERE THERE BE MONSTERS */
- function addToPerson( ){
- //receives three parameters: an object of a person, the name of a property to be added, and the value for that property
- //add the property given to the object, and return the object
- }
- function passDataToCallback( ){
- //receives a parameter of an unknown type and a parameter which contains a function
- //pass the first parameter into the function given as the second parameter, and return the return value from that function being called
- }
- /* END CHALLENGE MODE */
- /* TESTING AREA - complete instructions below to test all of your functions that you built, and make sure that you check that they are functioning normally!! */
- /* MAKE SURE YOU LABEL YOUR CONSOLE LOGS */
- //call logHello function
- //call logMessage, and pass forward a message of your choice
- //log the value of the message variable
- //log the value of the pixelValue variable
- //call enjoyTheSilence with a string parameter of your choice - what shows up in the console?
- //log the value of the multipliedNums variable
- //log the value of squaredNum
- //log the value of me
- //log the value of groceryList
- //call addToList with another item you need to buy
- //log groceryList again
- //call logMessage with its parameter being the return from calling squareNumber with a number of your choice
- //you MAY NOT use any variables created above or create any new variables to accomplish this
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement