🌐
Codecademy
codecademy.com › learn › introduction-to-javascript
Learn JavaScript | Codecademy
In this project, we're going to practice variables and printing to the console in JavaScript so you can hone your skills and feel confident taking them to the real world. Why? You've got to master the basics.
Rating: 4.5 ​ - ​ 32.3K votes
🌐
freeCodeCamp
freecodecamp.org › news › full-javascript-course-for-beginners
Full JavaScript Course for Beginners
June 21, 2021 - If you don't already know how to program in JavaScript, this is a great time to learn. We just released a 7-hour beginner's JavaScript course on the freeCodeCamp.org YouTube channel. Per Borgen created the course.
Discussions

Confused with JS freecodecamp tutorial
Maybe check out the free JS course on scrimba ? Those are usually a little more interactive with visual results as well in the form of a website you build along with the instructor. More on reddit.com
🌐 r/learnjavascript
29
17
December 20, 2023
Requesting Guidance with Record Collection problem in JavaScript Algorithms and Data Structures curriculum

I used the switch statement it made things easy for me

More on reddit.com
🌐 r/FreeCodeCamp
2
4
September 2, 2019
Basic Javascript: Record Collection [Please Help]

You're really close! It looks like each of your branches has a minor mistake or 2.

  1. You want to be using = for assignment, not == which is for comparison.

  2. Right now you'll never hit this branch, because you're checking for the tracks property on the whole collection, you want to check it for a specific id.

You're also catching one test you don't want to be in this branch. updateRecords(collection, 2548, "tracks", "") will go to this branch, because it has the property tracks. You also need to check that it doesn't have a value.

Once you're in there, you're really close! You just want to push only the new track (aka value) not an array of the value. push will put whatever you give it into the array, it doesn't squish 2 arrays into 1 (concat does that)

3) You'll see when you're hitting this branches it says TypeError: Cannot read property 'push' of undefined. This makes sense because object[id][prop] which in the first test parses to collection[5439]tracks doesn't exist, and you can't push to an array that doesn't exist. You just want to assign it to your value instead.

4) You're just missing the return statement here :)

Without further ado, this is how I would modify your code to pass all the tests:

function updateRecords(object, id, prop, value) {
if (prop !== "tracks" && value !== "") {
object[id][prop] = value;
return object;
} else if (prop == "tracks" && object[id].hasOwnProperty("tracks") && value) {
object[id][prop].push(value);
return object;
} else if (prop == "tracks" && value !== "") {
object[id][prop] = [value];
return object;
} else if (value == "") {
delete object[id][prop];
return object
}
}

Finally here is how I would refactor / reorganize your code to make it a little cleaner. This step is totally optional though!

function updateRecords(object, id, prop, value) {
if (!value) {
delete object[id][prop];
} else if (prop !== "tracks") {
object[id][prop] = value;
} else if (object[id].hasOwnProperty("tracks")) {
object[id][prop].push(value);
} else {
object[id][prop] = [value];
}
return object
}
More on reddit.com
🌐 r/FreeCodeCamp
6
13
March 13, 2018
Javascript basic algorithm scripting - How I can solve these problems? Help! : FreeCodeCamp
Get the Reddit app · Scan this QR code to download the app now · Or check it out in the app stores More on reddit.com
🌐 r/FreeCodeCamp
People also ask

What is JavaScript?
JavaScript is one of the most popular languages in the world. It's powerful and versatile, and with HTML and CSS, it forms the foundation of modern web development.
🌐
codecademy.com
codecademy.com › learn › introduction-to-javascript
Learn JavaScript | Codecademy
Why is JavaScript so popular as a first coding language?
JavaScript is a great choice for a first language. It's already built into most web browsers, so you can jump in and start coding without setting up an integrated development environment. Plus, its syntax is fairly easy to read — and it supports multiple programming styles, so much of what you'll learn is transferable to other languages.
🌐
codecademy.com
codecademy.com › learn › introduction-to-javascript
Learn JavaScript | Codecademy
What does JavaScript do?
JavaScript is mainly used to add animations and interactive elements to websites, but there are libraries and frameworks that extend its use into mobile development, game development, and more. You can even use it to build virtual reality applications and artificial intelligence.
🌐
codecademy.com
codecademy.com › learn › introduction-to-javascript
Learn JavaScript | Codecademy
🌐
freeCodeCamp
freecodecamp.org › news › learn-javascript-with-clear-explanations
Learn JavaScript with Clear Explanations
May 14, 2024 - We just published a new JavaScript course on the freeCodeCamp.org YouTube channel that is designed to take beginners through the basics of JavaScript with clear explanations and quiz sections.
🌐
freeCodeCamp
freecodecamp.org › news › tag › javascript
JavaScript - freeCodeCamp.org
Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice.
🌐
freeCodeCamp
freecodecamp.org › news › learn-javascript-for-beginners
Learn JavaScript for Beginners – JS Basics Handbook
September 8, 2025 - The goal of this handbook is to quickly introduce you to the basics of JavaScript so you can start programming applications. Instead of covering all the theories and concepts of JavaScript, I'll be teaching you only the most important building ...
🌐
freeCodeCamp
freecodecamp.org › news › freecodecamps-new-javascript-certification-is-now-live
freeCodeCamp's New JavaScript Certification is Now Live
5 days ago - The new JavaScript certification will teach you core concepts including variables, functions, loops, objects, higher order functions, DOM manipulation, working with events, asynchronous JavaScript, and more.
Find elsewhere
🌐
Quora
quora.com › Is-the-JavaScript-course-provided-by-freeCodeCamp-worth-it-Im-new-to-the-language-but-not-a-beginner-in-programming-and-data-structures
Is the JavaScript course provided by freeCodeCamp worth it? I'm new to the language but not a beginner in programming and data structures. - Quora
Answer (1 of 4): If you already understand programming, use Google to learn the syntax of JavaScript. (part of a string javascript returns 174 million hits for substr(), substring() and other things that can be used, depending on exactly what you need). After a while, things start sticking in you...
🌐
freeCodeCamp
freecodecamp.org › news › javascript-essentials
JavaScript Essentials
March 13, 2025 - Taught by Steven Garcia, this comprehensive course covers a wide range of JavaScript topics, including object creation, inheritance, ES6 features, Node.js, and handling asynchronous code effectively.
🌐
freeCodeCamp
freecodecamp.org › news › learn-javascript-free-js-courses-for-beginners
Learn JavaScript – Free JS Courses for Beginners
December 9, 2021 - In this freeCodeCamp course, you will learn about basic JavaScript, ES6, regular expressions, basic data structures, Object Oriented Programming, and functional programming.
🌐
LinkedIn
linkedin.com › pulse › javascript-algorithms-data-structures-freecodecamp-eamonn-cottrell
Javascript Algorithms and Data Structures on freeCodeCamp
December 20, 2021 - And thus, I came back to freeCodeCamp. Throughout the course of the Javascript Algorithms and Data Structures material, I was grateful for the bite-sized lessons that have you learning bits and pieces of the language and the mechanisms to program with it. But beyond that, the projects were where I could tell the true tests stood.
🌐
freeCodeCamp
freecodecamp.org › news › learn-javascript-with-new-data-structures-and-algorithms-certification-projects
Learn JavaScript by Building 21 Projects – a Major freeCodeCamp Curriculum Upgrade
December 20, 2023 - For the first project, you'll learn ... in JavaScript by coding your own Role Playing Game. You'll learn how to work with arrays, strings, objects, functions, loops, if/else statements, and more.
🌐
Reddit
reddit.com › r/learnjavascript › confused with js freecodecamp tutorial
r/learnjavascript on Reddit: Confused with JS freecodecamp tutorial
December 20, 2023 -

So I just recently finished the html and css sections of freecodecamp and went to JS next on my journey to hopefully become a front-end developer somedays. After a couple of hours of JS tutorials I am having a really hard time adjusting to this new style of learning.

With html and CSS I could pretty much immediately see results when I learned a new concept because it was visualized right away. With Javascript, I am learning about Arrays, Strings, functions etc. but I have zero imagination about what to do with any of these. I am just wondering if this will become better the longer I keep studying or if there is a better, sort of hands-on way to learn with real-world examples and use cases of different concepts I am learning.

Happy about any input!

Top answer
1 of 5
8
Maybe check out the free JS course on scrimba ? Those are usually a little more interactive with visual results as well in the form of a website you build along with the instructor.
2 of 5
6
The longer you keep studying, the more connections you will build between the core foundation and the application of that foundation in Javascript To use one of the things you mention as an example, take arrays. When you're shopping on Amazon you have a button that says "show only items under $25" When the page requests data from the product database via the amazon web server, it will be returned to the page in the form of a Javascript array and look something like this, heavily simplified: const products = [ { productName: "Microwave", price: 50 }, { productName: "Cutting Board", price: 10 }, { productName: "Kettle", price: 20 }, ]; You can then use Javascript to perform the action you need. The following code will remove all items over $25: const cheapStuff = products.filter((product) => product.price <= 25); Once you have that filtered data you can use other Javascript methods to remove or hide any DOM elements (HTML) for the items that aren't in that filtered list. There's obviously more to it than that, but at it's core that basic stuff is pretty much what all interactive web apps distill down to. (To the "well actually" folks reading this, yes the filtering on Amazon will presumably happen at the database level, but let's hand wave that away for now, the principle is the same)
🌐
We Will Code
wewillcode.com › home › freecodecamp’s introduction to javascript, basic javascript
freeCodeCamp's Introduction to Javascript, Basic Javascript - We Will Code
March 21, 2023 - freeCodeCamp’s Introduction to Javascript, 2023 Basic Javascript freeCodeCamp’s Introduction to Javascript, Comments, Variables, & Casing freeCodeCamp’s Introduction to Javascript, Math Operators in JS (pt.2) freeCodeCamp’s Intro to Javascript, Compound Assignment & String Literals (3) freeCodeCamp’s Javascript Introduction, Escape Sequences, Concatenation.
🌐
freeCodeCamp
freecodecamp.org › news › learn-javascript-full-course
Learn JavaScript - Full 134-Part Course for Beginners
December 10, 2018 - This complete 134-part JavaScript course for beginners will teach you everything you need to know to get started with the JavaScript programming language. The font-size in this course is large, making it perfect for viewing on small screens.
🌐
Codefinity
codefinity.com
Codefinity: Courses with certificates | Online Learning Platform
Learn the fundamentals of web development while harnessing the power of AI tools like ChatGPT. Understand the roles of HTML, CSS, and JavaScript in building websites and how AI can enhance your coding speed and creativity.