Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Think like Coders with Javascript magic!!

Rating
-
Sold
-
Pages
9
Uploaded on
28-05-2026
Written in
2025/2026

JavaScript Fundamentals Questions is a practical workbook designed to improve JavaScript problem-solving and critical thinking skills through code prediction exercises. It covers essential concepts like closures, hoisting, arrays, objects, loops, truthy and falsy values, and unusual JavaScript behaviors. Ideal for beginners, students, and aspiring developers preparing for interviews, coding assessments, or strengthening their understanding of core JavaScript fundamentals.

Show more Read less
Institution
Course

Content preview

JavaScript Fundamentals
Code Snippet Prediction Exercises
Improve Your JavaScript Thinking Skills

These exercises are designed to strengthen your understanding of JavaScript fundamentals
by helping you predict how code executes before running it.

Many examples include unusual or less common JavaScript behaviors that professional
developers still benefit from understanding deeply.




How to Use This Workbook
Before running any code:

1.​ Read the snippet carefully.
2.​ Predict the output.
3.​ Explain why the output happens.
4.​ Run the code in your browser console or Node.js.
5.​ Compare the actual result with your prediction.
6.​ Modify the code and test your understanding further.

The goal is not memorization — it is learning how JavaScript actually works behind the
scenes.




Priority 1 — Essential Concepts
These are the most important exercises and should be fully understood.




Exercise 1 — Assignment Inside an if Statement
Predict the Output
let myNumber = 0;

, if (myNumber = 10) {
​ console.log('Hacked!')
}

console.log(myNumber)



Questions

●​ What will be printed to the console?
●​ Why does the condition evaluate as truthy?
●​ What is the difference between:
○​ =
○​ ==
○​ ===




Exercise 2 — Unlimited Function Arguments
Goal

Implement a function called combineNames() that works for all examples below.

Rules

●​ The final name should be uppercase.
●​ If only one name is provided, it should remain unchanged.

Examples
combineNames('David')
// Returns: 'David'

combineNames('John', 'Doe')
// Returns: 'John DOE'

combineNames('Jean', 'Marie', 'Vianney')
// Returns: 'Jean Marie VIANNEY'

combineNames('Neymar', 'Silva', 'Santos', 'Junior')
// Returns: 'Neymar Silva Santos JUNIOR'



Questions

●​ How can a function receive unlimited arguments?

Written for

Institution
Course

Document information

Uploaded on
May 28, 2026
Number of pages
9
Written in
2025/2026
Type
Class notes
Professor(s)
Ange pauline
Contains
All classes

Subjects

$10.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
paulineumunyana

Get to know the seller

Seller avatar
paulineumunyana African Leadership University
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
2 weeks
Number of followers
0
Documents
1
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions