By the end of this lesson, you will know how to Test, Publish, and Present Your Project. This process will help you share your work effectively.
Test, Publish, and Present Your Project starts with testing. First, testing is essential before publishing your project. It ensures everything works correctly. Think of it like checking your homework before handing it in. You need to make sure there are no errors and that all features function as expected because this step is crucial.
After testing, it’s time to publish your project. This means sharing it with others, like friends or teachers. You can use platforms like GitHub Pages or Netlify to upload your code. Therefore, people can access your project online, which is a great way to showcase your skills and creativity. As a result, your work gets the recognition it deserves.
Finally, presenting your project is a chance to showcase your work. You can explain how it works and what you learned during the process. Also, keep your presentation clear and show enthusiasm to engage your audience! This can be your opportunity to inspire others about your project.
File: student-dashboard.js
// student-dashboard.js
const courses = [
{ name: "Math", completed: true },
{ name: "Science", completed: false },
{ name: "History", completed: true }
];
function displayCourses() {
courses.forEach(course => {
console.log(course.name + (course.completed ? ' (Completed)' : ' (Not Completed)'));
});
}
displayCourses();
Expected Output:
Math (Completed)
Science (Not Completed)
History (Completed)
In this code, we have an array of course objects. Each object contains the course name and whether it’s completed. The displayCourses function loops through the courses and prints their names, adding a note about completion status. This makes it easy to see your progress.
Now, create a function that adds a new course to your array. The function should take a course name and a completion status as parameters. Modify the existing code to include this new function, and display all your courses again. This task will give you practical experience in coding.
// student-dashboard.js
const courses = [
{ name: "Math", completed: true },
{ name: "Science", completed: false },
{ name: "History", completed: true }
];
function addCourse(name, completed) {
courses.push({ name, completed });
}
function displayCourses() {
courses.forEach(course => {
console.log(course.name + (course.completed ? ' (Completed)' : ' (Not Completed)'));
});
}
addCourse("Art", false);
displayCourses();