Hello Devs! π
Today marks Day 1 of my DSA (Data Structures & Algorithms) learning journey, and Iβve decided to share everything I learn daily to stay consistent and maybe help fellow beginners too!
I'm following the Akshay Saini DSA course, and today was all about warming up with JavaScript fundamentals. Here's a quick summary of what I learned π
π° Course Introduction
The instructor started with a great piece of advice:
βDon't just learn DSA for interviews. Understand the concepts deeply β interviews will become easy automatically.β
He also suggested maintaining our own notes or copy β writing things down helps a lot in revision!
π₯ JavaScript Basics Refresher
1οΈβ£ console.log("Hello Laxman")
This simple line prints text to the console. The value "Hello Laxman" is a string β in JavaScript, strings are enclosed in double quotes ("") or single quotes ('').
2οΈβ£ Data Types
Some basic JavaScript data types are:
String β "hello"
Number β 10, 3.14
Boolean β true, false
Object β { key: "value" }
Array β [1, 2, 3]
2οΈβ£ Variable Declarations: let vs const
let a = 10; β allows reassignment (a = 20 is fine)
const b = 15; β does not allow reassignment (b = 20 will throw an error)
We can access them like:
console.log(a); // Output: 10
3οΈβ£ Arrays
Arrays in JavaScript are declared using square brackets [] and can hold multiple values β even of different types:
let arr = [1, true, false, [1, 2]];
Accessing values:
arr[0] β 1
arr[3][0] β 1 (nested array access)
Arrays store data as index-value pairs, starting from index 0.
4οΈβ£ Objects
Objects are declared using curly braces {} and store data in key-value pairs:
let person = { name: "Laxman" };
console.log(person.name); // Output: Laxman
π Wrap-up
Thatβs all I learned today! It's a simple warm-up, but a good reminder that a strong foundation in JavaScript will help understand DSA more clearly when we dive deeper into arrays, objects, and problem solving.
Iβll be sharing my progress daily. Feel free to connect or follow along if you're also on this path!
Until tomorrow, happy coding! π
Top comments (0)