🔧 Day 6/366
Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to
🚀 Today's Learning:
🌟 DSA
- To Lower Case - Leetcode 709
- Count vowels & consonants in a string
🌟 Dev
- Abstraction and Private Variables/Methods in JS
- Pass by Value vs Pass by Reference
- Callback Hell and Prevention
🔍 Some Key Highlights:
DSA
To Lower Case - Leetcode 709
Approach → Iterate through the string → if s[i] is ≥ 65 and s[i] ≤ 90 this means it’s a uppercase letter, so just add 32 to it so it goes to lowercase letter range. Note: uppercase and lowercase letters have a fixed difference of 32.
Count vowels & consonants in a string
Approach → create two variables - vCount and cCount initialized with zero. Iterate through the given string → if (s[i] == ‘a’ || s[i] == ‘A’ || s[i] == ‘e’ ..and so on) increment vCount → else if (s[i] ≥65 && s[i] ≤90 || s[i] ≥ 97 && s[i] ≤ 122) increment cCount. Now we get the count of both vowels and consonants in the string.
DEV
Abstraction in JavaScript involves hiding the complexity of code and showing only the necessary details. Private variables and methods are crucial for encapsulating data and preventing direct access from outside the scope. JavaScript doesn't have built-in support for private variables, but we can achieve this using closures.
In JavaScript, primitive data types like strings and numbers are passed by value, while objects (including arrays and functions) are passed by reference.
Callback hell refers to deeply nested callback functions, making code hard to read and maintain. Promises and async/await are modern solutions to mitigate callback hell.
...
🔧 Day 4/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 21/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 37/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 20/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 36/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 3/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 19/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 35/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 1/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 18/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 34/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 17/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 32/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 16/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 32/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 15/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 31/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 14/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 30/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 13/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 29/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 12/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 28/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 43/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 11/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 28/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 42/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 10/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 26/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 41/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 9/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 25/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 40/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 7/366
📈 18.81 Punkte
🔧 Programmierung
🔧 Day 24/366
📈 18.81 Punkte
🔧 Programmierung