Assalamualaikum!

I am Nizam

Student of Batch-7

Module-20: Core Concepts functions and Objects

Video 20-0 : [Recap] Loop and Conditions

Video 20-1: Module Introduction and Concept Recap

1. Primitive Data Types and 2. Composite / Non-Primitive Data Types.
Primitive types: numbers, string, boolean,(null, undefined)/Trivial/ Other data types. Non Primitive: Objects, arrays.

Video 20-2 : Declare a Function, call function, function vs loop

Video 20-3 : Add Function parameter, handle multiple parameters

Video 20-4 : Everything you need to know about return from a function

function add(number1, number2){
console.log(number1, number2);
var sum = number1 + number2;
return 15;
} add(45, 15);

Video 20-5 :Function examples and Function summary

Search javascript square function

Video 20-6 :Function examples and Function summary

Video 20-7 multiple ways to get and set object property

Video 20-8 (advanced) Looping through an Object and Object summary

Video 20-9 Module summary and practice problem

QUIZ

Q1: Do I always have to add parameters to every function?
Ans: Parameter are optional, you will add them when needed

Q2: Which of these is a valid line of JS code that stores an object in a variable
Ans: var me = {age:31, hair:'brown'};

Q3: var movie = {name: “Din- The Day”}; How will you change or update the name property of the movie object?
Ans: movie.name = 'Hawa';

Q4: Don’t forget the array. Tell me the index of 6 in nums array. var nums = [4, 5, 7, 6, 8, 2, 4, 1, 15];
Ans: 3

Q5: How can you get the brand name from the smartphone object? var smartphone = { brand: "iPhone", model: "13" };
Ans: console.log(smartphone.brand);

Q6: Which keyword will you use to get output from a function that you can set to a variable?
Ans: return

Q7:Is there anything wrong with this code? functon add(num1, num2){ }
Ans: Be careful. Some important keyword is misspelled

Q8:How will you call the function mentioned below? function askForCookies() { console.log("Granma please give me cookies"); }
Ans: askForCookies();

Q9:What will be the output of this program? function movie(){ return "Din-The day"; return "Poran"; return "Hawa"; } console.log(movie());
Ans: Din-The day

Q10:How many parameters can you add to a function?
Ans: As many as you would like

Copyright ©2023 Allright Reserved