Functions in JavaScript | JavaScript Tutorial in Hindi #11

This video is about functions in JavaScript Link to the Repl – Join Replit …


  1. Coding Challenge #javascriptFunctions

    Challenge 1

    Create a function expression with mainFunc as the variable name, which takes only one parameter of function type and calls that function inside the mainFunc.

    Hint: create a secondary function that has a simple console.log method with any string.

    Challenge 2

    Create a function addNum which takes 2 parameters. The first is an integer value and the other is a function type parameter. When addNum is invoked(called), it should return the sum of the first parameter and the return value from the second parameter(which is 10 here).

    Hint: the second function should return 10.

    Challenge 3

    Given an array of cars manufacturers whose values are given below. The array doesn’t have uniformity in the values. Create a function that takes the manufacturers as a single parameter returns an object having 2 keys ‘allLowerCase’ and ‘allUpperCase’ whose values are processed values in lower case and upper case respectively.

    manufacturers = ['audi', 'BMw', 'ForD', 'mG', 'tata', 'MAHINDRA'];

Leave a Reply

© 2023 53GB