/* this was my best attempt at creating a way to learn these things while simulataneously implementing them */
JavaScript Lecture Notes

Lecture Notes

DISCLAIMER: I am not affiliated with freecodecamp and this is purely for educational purposes.

This page is just an information dump for the lecture portion of codecamp courses so far for my own notetaking purposes

  1. JavaScript

  2. What is a Code Editor and IDE?

    Code editor is an application that lets you edit code files, and IDE(Integrated Development Environment) lets you compile, run and debug code. IDEs are Visual Studio, Xcode, Android Studio. Code editors are VS code, sublime text, notepad++. There are also cloud based editors to write code online such as replit, github codespaces, and ona.

  3. How to Install Visual Studio Code onto Your Computer

    This article tells you to download VS code and install it on 3 different OS.

  4. How to Create a Project and Run Your Code Locally in VS Code

    VS code uses workspaces, you will need to use command lines to create a direction for your project. You can use command prompt commands such as cd ~ to go back to home directory. mkdir my-project to make a folder that is called my-project. After opening a new directory get the live server extension to host your website and view changes.

  5. What Are Several Useful Keyboard Shortcuts for Maximizing Productivity in VS Code?

    Goes over keyboard shortcuts like ctrl s to save, ctrl c copy, ctrl v paste. Shift+alt+f will run your configured formatter such as prettier. Ctrl Shift F to search all the text in your workspace. Ctrl Shift H to find and replace. Ctrl Shift K to delete a line. Ctrl b to hide the file list. Ctrl + or minus to make scaling bigger or smaller. Ctrl Shift P to see a list of commands.

  6. What Are Some Good VS Code Extensions You Can Use In Your Editor?

    Goes over some useful extensions. Better Comments, code spell checker, error lens, indent rainbow, vs code great icons, colorize, eslint, prettier, vs code pets, power mode, discord presence.

  7. What Is JavaScript, and How Does It Work with HTML and CSS?

    Javascript is a language that is designed to bring interactivity and dynamic behavior to websites. Compares javascript to CSS and HTML. JavasScript is a programming language, HTML/CSS markup languages.

  8. What is a Data Type, and What Are the Different Data Types in JavaScript?

    Data types refer to the kind of value a variable can hold. A variable is a name container to store a specific value. Number is the first data type and represents integers and floating point values. Next is string which is a sequence of characters. Boolean is another type which represents true or false. Next two are undefined(undeclared) and null(nothing).

    Another type is Object which is made of keys and labels to store data. A symbol type is a value that is unique and cannot be changed. BigInt is the last one which is for very large numbers it is created by adding a n at the end of a large number.

  9. What Are Variables, and What Are Guidelines for Naming JavaScript Variables?

    Variables are containers for storing data that you can access and modify. You can declare a variable using the let keyword. The assignment operator is =, which isn't quite equal.

    Naming variables should be descriptive so the code is easier to understand. Variables must begin with a letter, an underscore, or a dollarsign. They cannot start with a number. Variables are case sensitive and important to stick with a convention like camelCase. You cannot use keywords as names for variables such as let, const, function, or return. Avoid special characters other than underscore and dollar signs.

  10. How Do let and const Work Differently When It Comes to Variable Declaration, Assignment, and Reassignment?

    Variables are usually declared by let or const. Let lets you declare variables that can be updated and reassigned later. Const is meant for variables that are constant and you cannot reassign them. You can also use the var keyword but it is not recommended over let since it has a wider scope and is likely to cause problems.

  11. What is a String in JavaScript, and What is String Immutability?

    A string is a sequence of characters used to represent text data. To create a string you can use '' or "" but not a mix like '". Strings are immutable which means that once they are created they cannot be changed.

  12. What Is String Concatenation, and How Can You Concatenate Strings with Variables?

    String Concatenation is joining pieces of text together. The + operator can be used to concatenate strings like firstName + LastName. One of the weaknesses of + operator is the spacing can sometimes be problematic. You can also use the += operator or the concat() method.

    A function is a reusable block of code that performs a specific task and a method is a type of function that is associated with an object. Concat is useful when you want to concatenate multiple strings together.

  13. What Is console.log Used For, and How Does It Work?

    console.log() is a simple tool to display messages or output to a browser. Console log method helps you monitor code as it runs and spot mistakes throughout the code.

  14. What Is the Role of Semicolons in JavaScript, and Programming in General?

    The ; is used to delineate statements and improve code readibility. It represents the end of a statement. This helps to separate individual instructions for proper execution. Javascript has automatic semicolon insertion (ASI) which can add them automatically but explicitly including them helps prevent errors. ; is used in C, C++, and Java.

  15. What Are Comments in JavaScript, and When Should You Use Them?

    Comments are used to provide additional context for code or for notetaking. They are ignored when the code is executed and single line comments are created using //. You can also create multi line comments with /* */. Try not to overcomment especially when the function is obvious.

  16. What Is Dynamic Typing In JavaScript, and How Does it Differ From Statically Typed Languages?

    Javascript is dynamically typed because you don't have to specify variable types on declaration. This flexibility makes JavaScript easy for quick scripting but it can make bugs harder to catch as programs get larger. In a static language like C++ you must declare a variable type when created and it can't change. Dynamic languages are flexible, static languages have fewer runtime errors.

  17. How Does the Type of Operator Work, and What Is the Type of Null Buiig in JavaScript?

    The typeof operator lets you see the data type of a variable or value. It returns a string indicating the type. It will return something like "number", "boolean", etc.There is a bug where nulls will sometimes return "object".

  18. What Is Bracket Notation, and How Do You Access Characters From a String?

    Bracket notation allows you to retrieve the strings sequence of characters. You can do this with its index which is zero based, meaning it starts with 0,1,2. It uses [] and the index of the character you want to access. You can get multiple characters by + and writing out both variable[index]. This is useful when extracting initials or checking a specific letter for validation.

  19. How Do You Create a Newline in Strings and Escape Strings?

    You can create new lines using an escape sequence. Most common is \n. Another important concept is escaping characters. This is important when you want to include quotes in output. You can fix this by putting a \ in front of the quotes like statement = "She said, \"Hello!\"";

  20. What Are Template Literals, and What Is String Interpolation?

    Template literals are defined with backticks or `. They allow for string manipulation like putting directly directly in a string or string interpolation. String interpolation can be much easier to read when using multiple variables. Template literals also allow you to make multiline strings without using \n. The ${name} syntax is an example of string interpolation.

  21. How Can You Find the Position of a Substring In a String?

    Sometimes you may need to find the specific substring within a larger string. Like hello or world within hello world. You can use the indexOf() method to search for a substring. If the substring is found it will return the first index of that substring. If the substring is not found it returns -1. indexOf() requires two arguments the substring you want to find, and the position you want to start the search from. You can express both variables like indexOf("JavaScript", 10);.

  22. What is the prompt() Method, and How Does It Work?

    The prompt method opens a dialog box that asks the user for some input, then returns it as a string. If a user types a name and presses okay, it will be stored. If they cancel it will be set to null. The rest of the code will not run until the user interacts with the dialog box. The second optional box is what the input initially contains.

  23. What is ASCII, and How Does It Work with charCodeAt() and fromCharCode()?

    ASCII (*AMerican Standard Code for Information Interchange) is a character encoding standard that assigns a numeric value to each character. Example A is 65, a is 97. The ASCII standard covers 128 characters including A-Z,a-z, 0-9, common punctuation, and control characters.


    You can easily access teh code of a character by using charCodeAt(). This method will call a string and return the ASCII code of the character at a specified index (console.log(letter.charCodeAt(0)). fromCharCode() will let you do the opposite, convert ASCII code to the character. This can be useful to check cases and to dynamically generate characters.

  24. How Can You Test if a String Contains a Substring?

    A substring is a smaller part of a string. You can check whether input has a specific word or character by using the includes() method. This method will return a boolean. Includes is case sensitive, and you can also test if it starts at a specific index using the second parameter. Ex. let result = text.includes("JavaScript", 7);

  25. How Can You Extract a Substring from a String?

    If you want to take a certain substring from a larger string you can use the slice() method. This does not modify the original string but lets you take just a part (string.slice(startIndex, endIndex);. The endIndex part is optional, because it will go to the end of the string without it.

  26. How Can you Change the Casing for a String?

    You may need to change strings to all uppercase or lowercase in different situations. You can do these with 2 methods, toUpperCase() and toLowerCase(). Neither method changes the original string, just creates a new string with the requested credentials.

  27. How Can You Trim Whitespace from a String?

    White space refers to spaces, tabs, linebreaks. You can trim this using the methods trim(), trimStart(), trimEnd(). trim() removes white space from beginning and end. trimStart beginning, trimEnd from the end.