0% found this document useful (0 votes)
17 views1 page

Javascript Questions

The document outlines a series of JavaScript problems focused on basic arithmetic functions, array manipulations, loops, and object handling. It includes tasks such as creating functions for sum, subtraction, multiplication, finding averages, and printing patterns. Additionally, it involves iterating over objects and adding methods to them to display properties.

Uploaded by

Jecholiah Wise
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views1 page

Javascript Questions

The document outlines a series of JavaScript problems focused on basic arithmetic functions, array manipulations, loops, and object handling. It includes tasks such as creating functions for sum, subtraction, multiplication, finding averages, and printing patterns. Additionally, it involves iterating over objects and adding methods to them to display properties.

Uploaded by

Jecholiah Wise
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

JS Problem List

Q1- write x3 functions that takes two integers (a, b) and returns their: sum, sub,
mul

Q2 - write x1 function that takes two integers (a, b) and a string (operation) &
decides what operation to do based on operation string: ("add", "sub", "mul")

Q3 - Write a function that takes an array & returns sum of all numbers

Q4 - use this function in Q4 to find mean or average of numbers in an array

Q5 - Find maximum of all numbers in an array

Q6 - Loops - Given integer n, print it's table


Ex: for n = 4, it's table looks like
4 * 1 = 4
4 * 2 = 8
4 * 3 = 12
4 * 4 = 16
4 * 5 = 20
4 * 6 = 24
4 * 7 = 28
4 * 8 = 32
4 * 9 = 36
4 * 10 = 40

Q7 - Write a function that print "n" number of stars


Example: for n = 5, it should print "*****"

Q8 - Function that prints star in these pattern given n = 5 for example


*
* *
* * *
* * * *
* * * * *

Q9 - iterate over an array of objects & print details


const person1 = {
name: "Rohit",
age: 21
}
const person2 = {
name: "Rohit",
age: 21
}
const person3 = {
name: "Rohit",
age: 21
}
let people = [person1, person2, person3];

Q10 - add a function inside above objects that prints name & age

You might also like