Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Submit all the HTML / JS codes and a screenshot of the output in a PDF file. Write the question number and then code. Do

Submit all the HTML/JS codes and a screenshot of the output in a PDF file.
Write the question number and then code.
Do not submit screenshots of the source code.
Q#1. Write a JavaScript program that uses the lowdash library to perform the following tasks:
a. Create a function filterEvenNumbers that takes an array of numbers as input and returns a new array containing only the even numbers.
b. Create a function calculateAverage that takes an array of numbers as input and returns the average of the numbers using the lowdash library.
c. Create a function getUniqueValues that takes an array of values as input and returns an array containing only the unique values using the lowdash library.
Q#2. Do the following tasks:
a. Check the versions of Node.js and npm installed on your computer as follows:
b. Install the moment.js library as follows:
PS C: \xampp\htdocs \JavaScript\Lecture15> npm install moment
Show a screenshot of the package.json or moment folder in the node_modules folder.
c. Save the following code in a JS file.d. Run the JS code on the terminal as follows and display the result:PS C: \xampp\htdocs\JavaScript\Lecture17> node .\assignment5-Q2-moment.js
Q#3. Develop a simple animation or game (very simple, or only a few lines of code) using JavaScript.
Q#4. Create an HTML file called calculator.html and a JavaScript file called calculator.js. The JavaScript program should perform basic arithmetic operations, as shown in the figure below, and displays the results.
Validate the values using JavaScript. The program should handle different input scenarios, such as non-numeric inputs or division by zero. Implement error handling to display appropriate error messages in such cases.
Write your JavaScript program using functions and proper variable declarations. Test your program with various input values to ensure it behaves correctly.
Use alert or innerHTML for output.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Application Development And Design

Authors: Michael V. Mannino

1st Edition

0072463678, 978-0072463675

More Books

Students also viewed these Databases questions