Clone the following GitHub repository and open it via VS Code.
Now, Add the “app.js” file using the <script> tag in the index.html file. Open the file using Live Server. Look at the file closely. Now, what you have to do is “the mobile case quantity will be increased while you’ll be clicking on the plus button”.
So, to do that you have to add an event listener and then write a function where the input value will be extracted, and then after incrementing 1 the value will be reassigned in…
Module 26: Functional Website
As you can that many lines of the code had been repeated in the simple bank website which is not good at all. So, to make the code look clean and more professional you can use functions for similar types of tasks.
Now, you’re going to use a function instead of those similar blocks of code.
Look closely and you’ll see that the code for handling the “deposit-input” and “withdraw-input ” looks mirror. …
Module 25: Simple Bank Transaction
Create a project folder naming it “Bank” and then create a file named “index.html”. Add a heading using <h1> tag. Link the Tailwind CSS. Now start designing the heading using Tailwind CSS classes. If you have forgotten all of the classes which you had used earlier you may go to their website and try searching the classes with relevant keywords (Shortcut: Ctrl+K).
Module 23: Event, addEventListener & Event Bubble
For example, when a user clicks over the browser, add js code, which will execute the task to be performed on the event.
Simply think of the Recursion as a simple version of for loop. You know how a for loop works. If you put these this like the for loop for instance,
This for loop will calculate the sum from 6 to 1. Now simply write a function that also does the same. In this case, you shall call the function itself inside the block which you as recursion.
Module 21: More JS Coding Problems
Write a program that will remove all the duplicate items from an Array.
At first, try and print out all of the elements of the array. You had used a for loop for this purpose. But there's one more type of loop which is more efficient and less complex and widely used for traversing an array. it’s
The for…of statement creates a loop iterating over iterable objects, including built-in String, Array, array-like objects (e.g., arguments or NodeList), TypedArray, Map, Set, and user-defined iterables. …
Math is a built-in object that has properties and methods for mathematical constants and functions. It’s not a function object.
Math works with the Number type. It doesn't work with BigInt.
The absolute value of a number x, denoted by |x|, is defined as:
The ceil() method rounds a number UPWARDS to the nearest integer and returns the result.
If the passed argument is an integer, the value will not be rounded.
The floor() method rounds a number DOWNWARDS to the nearest integer…
Using “var”, variables are function-scoped because their visibility is limited to the function. When you try to use it outside of the function, you’ll get an error.
In many ways “let” is like a cousin of “var”. It has a lot of similarities but differentiates in ways that makes ES2016 a more modern-feeling language.
Using “let” you can reassign variables, but its syntax is more strict than “var”.
The keyword “const” is an abbreviation for constant. …
Module 18: Core Concepts (Functions and Objects)
A function definition (also called a function declaration, or function statement) consists…