Lessons Summary
- Creating Strings:
- Use single quotes (
' '), double quotes (" "), or backticks (````) for creating strings. - Backticks (template literals) allow embedding JavaScript expressions using
${expression}.
- Use single quotes (
- Concatenation:
- Combine strings using the
+operator or by embedding variables into template literals with${}.
- Combine strings using the
- String Interpolation:
- Template literals with backticks provide a cleaner way to insert variables or expressions directly into a string.
- Indexing:
- Access individual characters in a string using square brackets (
[]) or the.at()method. at()also supports negative indices.
- Access individual characters in a string using square brackets (
- Substrings with
slice():- Extract parts of a string using
slice(startIndex, endIndex).
- Extract parts of a string using
- Escape Characters:
- Use
\for special characters like:\nfor new line\tfor tab\\for backslash- Unicode characters (e.g.,
\u2731outputs ✱)
- Use
Final Grades
3.8: 0.85 3.10: 0.85 3.2: 0.83 3.3 & 3.5: 0.8 3.6 & 3.7: 0.55
What I learned:
Collaboration and Communication
Working with others and collaborating has been a huge part of my growth throughout this project. Before, I was not as good at communicating my ideas or listening to others. But now, I have learned the value of both and that has contributed to my learning and progress in this class. I learned how to share my thoughts clearly, listen to different perspectives, and find solutions together. Collaboration made it easier to solve problems and helped me see the value in everyone’s input. I feel like I’ve become a more effective team member, and it’s taught me how important teamwork and good communication really are.
Diving Deeper into Javascript
Through this project, I’ve significantly improved my JavaScript skills. Before, I had a basic understanding of JavaScript, but now I can confidently use variables, loops, and functions. I’ve also learned how to use string manipulation, conditional statements, and arrays more effectively. Working on this project helped me apply these concepts in practical ways, and I feel much more comfortable writing, debugging, and improving my JavaScript code than I did before. I learned a lot through my teammates and other sources and perservered. Before this project, I never had a good grasp on javasscript. I knew a little python, but no javascript, however through this project and this class In was able to get past that and learn to fullest potential.
Relevancy Checklist
| Assignment | Link | Grade | Comments |
|---|---|---|---|
| College Board Coverage | (https://nighthawkcoders.github.io/portfolio_2025/csp/big-idea/p2/3-4-1) | 0.87 | I succeeded in covering all topics covered by collegeboard. |
| Examples | (https://nighthawkcoders.github.io/portfolio_2025/csp/big-idea/p2/3-4-1) | 0.9 | My examples were very detailed and painted a clear picture of what each part of the code did. |
| Popcorn Hack Usage | (https://nighthawkcoders.github.io/portfolio_2025/csp/big-idea/p2/3-4-3) | 0.89 | My Popcorn hacks were detailed and easy, but still required the coder to think. |
| Homework | (https://nighthawkcoders.github.io/portfolio_2025/csp/big-idea/p2/3-4-4) | 0.88 | The Homework was fairly easy, but still required some critical thinking. |
| Grading Plan | (https://docs.google.com/spreadsheets/d/1ytcHH94Pc_WQv6vFt-rMtssMYFeuX3M_wBlMs1neRXM/edit?resourcekey=&gid=631551841#gid=631551841) | 0.92 | We Graded everyone fairly and unbiased. We also rewarded students who went |
| Original and Creative | (https://nighthawkcoders.github.io/portfolio_2025/csp/big-idea/p2/3-4-1) | 0.9 | I put in hotlinks to each specific sublesson and added custom lessons, homework, and popcorn hacks to psice up the lesson. I also added more caption to explain the examples in a deeper way. |
| Total | 0.89 |
Impact of Treaching and Grading
- the grading process mainly focused on mastery of concepts and, and provide constructive criticism and feedback to my fellow students to help guide their learning and improvement.
- Teaching these lessons mainly helped with my confidence to tackle larger and more complex challenges because they helped fully flesh my technical skills in the basics and helped me improve my critical thinking.
What I need to work on
Something that I could work on is depending on my teammates and asking questions on points of confusion.
Guess the Number final Project
%%js
// Variables
let secretNumber = Math.floor(Math.random() * 100) + 1; // Random number between 1 and 100
let attempts = 5; // Number of attempts left
let output = document.createElement("p"); // Create a paragraph element to show messages
document.body.appendChild(output); // Append the paragraph to the body of the page
// Function to check the user's guess
function checkGuess() {
// Data abstraction: get user input from the text box
let guess = document.getElementById('guess').value;
guess = parseInt(guess); // Convert the input to an integer
let message = ""; // String to store the message
// Conditional statements to compare the guess with the secret number
if (guess < secretNumber) {
message = "Too low!";
} else if (guess > secretNumber) {
message = "Too high!";
} else {
message = "You got it!";
attempts = 0; // Set attempts to 0 to end the game
}
// Nested conditionals to check the number of attempts
attempts--;
if (attempts > 0 && message !== "You got it!") {
message += " You have " + attempts + " attempts left.";
} else if (attempts == 0 && message !== "You got it!") {
message = "Game over! The correct number was " + secretNumber + ".";
}
// Display the message in the paragraph
output.innerHTML = message;
}
<IPython.core.display.Javascript object>