JAVASCRIPT Quiz Time
var s = "Nat"; console.log("Ba" + s[0] + s.charAt(1) + "na"); What is the output of this code?
var s = "Nat"; console.log("Ba" + s[0] + s.charAt(1) + "na"); What is the output of this code?
Final Results
29%
undefined
19%
BaNundefinedna
52%
BaNana
Learn JavaScript™ pinned «JAVASCRIPT Quiz Time
var s = "Nat"; console.log("Ba" + s[0] + s.charAt(1) + "na"); What is the output of this code?»
var s = "Nat"; console.log("Ba" + s[0] + s.charAt(1) + "na"); What is the output of this code?»
Forwarded from Learn CSS™
Check out these cool websites for icons👇
🔹
🔸
🔹
🔸
🔹
🔸
🔹
🔸
🔹
🔹
icons .getbootstrap.com
🔸
simpleicons .org
🔹
boxicons .com
🔸
css .gg
🔹
evil-icons .io
🔸
feathericons .com
🔹
heroicons .dev
🔸
teenyicons .com
🔹
iconpark .bytedance.com
✨Found a super amazing GitHub repository🔥✨
Algorithms and data structures implemented in JavaScript👨💻
You'll understand complex algorithms and data structures with a great pictorial representation and reading
https://t.co/BGkhs3Mmci
Algorithms and data structures implemented in JavaScript👨💻
You'll understand complex algorithms and data structures with a great pictorial representation and reading
https://t.co/BGkhs3Mmci
Forwarded from Learn Html
✨3 websites I recommend every newbie to master their HTML and CSS skills✨
1.
2.
3.
1.
frontendmentor .io
2.
devchallenges .io
3.
awwwards .com
✨5 amazing GitHub repositories for Node.js developers✨
📌 Node Best Practice
- In this repo you'll find a divided list of best practice in terms of Projects, Error handling, code style, testing, docker file. etc...
🖇️ https://t.co/DqjYdMOYi0
📌 Awesome Node.js
- This is a huge huge list of awesome resources of Node.js in the form of packages, tutorials, articles, books, courses, tools, etc...
🖇️ https://t.co/4xD1AWTPAm
📌 Awesome Node.js Projects
- Curated list of awesome open-source applications made with Node.js
🖇️ https://t.co/JZ8FvGEHYY
📌 Boilerplate
- Start a new Node.js project with minimum efforts. A boilerplate for building production-ready RESTful APIs using Node.js, Express, and Mongoose
🖇️ https://t.co/Db99yVXpNV
📌 Node.js best structure
- This is a basic project structure for a node js project contain a full support for async/await , proper error handling, basic Joi Validation object oriented para-diagram and much more
🖇️ https://t.co/EIfwqtQ37L
Follow @learn_JavaScript_js for more JavaScript content.
_______________________
Follow my other channels
For HTML : @learn_html_web
For CSS : @learn_CSS_web
For PHP : @learn_php_web
For Programming tutorials/Courses/Materials :
@Programmingworld_dev
For any quires you can ask in this group :
@devlopers_hub
📌 Node Best Practice
- In this repo you'll find a divided list of best practice in terms of Projects, Error handling, code style, testing, docker file. etc...
🖇️ https://t.co/DqjYdMOYi0
📌 Awesome Node.js
- This is a huge huge list of awesome resources of Node.js in the form of packages, tutorials, articles, books, courses, tools, etc...
🖇️ https://t.co/4xD1AWTPAm
📌 Awesome Node.js Projects
- Curated list of awesome open-source applications made with Node.js
🖇️ https://t.co/JZ8FvGEHYY
📌 Boilerplate
- Start a new Node.js project with minimum efforts. A boilerplate for building production-ready RESTful APIs using Node.js, Express, and Mongoose
🖇️ https://t.co/Db99yVXpNV
📌 Node.js best structure
- This is a basic project structure for a node js project contain a full support for async/await , proper error handling, basic Joi Validation object oriented para-diagram and much more
🖇️ https://t.co/EIfwqtQ37L
Follow @learn_JavaScript_js for more JavaScript content.
_______________________
Follow my other channels
For HTML : @learn_html_web
For CSS : @learn_CSS_web
For PHP : @learn_php_web
For Programming tutorials/Courses/Materials :
@Programmingworld_dev
For any quires you can ask in this group :
@devlopers_hub
Learn JavaScript™ pinned «✨5 amazing GitHub repositories for Node.js developers✨ 📌 Node Best Practice - In this repo you'll find a divided list of best practice in terms of Projects, Error handling, code style, testing, docker file. etc... 🖇️ https://t.co/DqjYdMOYi0 📌 Awesome…»
✨ Found a super handy tool for you🔥✨
➵ A social media button generator with almost zero efforts🙅🏻♂️
🖇️ sharingbuttons.io
➵ A social media button generator with almost zero efforts🙅🏻♂️
🖇️ sharingbuttons.io
Consider the following arrays. What gets logged in various sorting conditions?
const arr1 = ['a', 'b', 'c']; const arr2 = ['b', 'c', 'a']; console.log( arr1.sort() === arr1, arr2.sort() == arr2, arr1.sort() === arr2.sort());
const arr1 = ['a', 'b', 'c']; const arr2 = ['b', 'c', 'a']; console.log( arr1.sort() === arr1, arr2.sort() == arr2, arr1.sort() === arr2.sort());
Final Results
16%
true true true
32%
true true false
26%
false false false
26%
true false true
Consider the following Set of objects spread into a new array. What gets logged?
const mySet = new Set([{ a: 1 }, { a: 1 } const result = [...mySet]; console.log(result);
const mySet = new Set([{ a: 1 }, { a: 1 } const result = [...mySet]; console.log(result);
Final Results
53%
[{a: 1}, {a: 1}]
47%
[{a: 1}]
Learn JavaScript™
Consider the following arrays. What gets logged in various sorting conditions?
const arr1 = ['a', 'b', 'c']; const arr2 = ['b', 'c', 'a']; console.log( arr1.sort() === arr1, arr2.sort() == arr2, arr1.sort() === arr2.sort());
const arr1 = ['a', 'b', 'c']; const arr2 = ['b', 'c', 'a']; console.log( arr1.sort() === arr1, arr2.sort() == arr2, arr1.sort() === arr2.sort());
Explanation:
There are a couple concepts at play here. First, the array sort method sorts your original array and also returns a reference to that array. This means that when you write arr2.sort(), the arr2 array object is sorted.
It turns out, however, the sort order of the array doesn't matter when you're comparing objects. Since arr1.sort() and arr1 point to the same object in memory, the first equality test returns true. This holds true for the second comparison as well: arr2.sort() and arr2 point to the same object in memory.
In the third test, the sort order of arr1.sort() and arr2.sort() are the same; however, they still point to different objects in memory. Therefore, the third test evaluates to false.
There are a couple concepts at play here. First, the array sort method sorts your original array and also returns a reference to that array. This means that when you write arr2.sort(), the arr2 array object is sorted.
It turns out, however, the sort order of the array doesn't matter when you're comparing objects. Since arr1.sort() and arr1 point to the same object in memory, the first equality test returns true. This holds true for the second comparison as well: arr2.sort() and arr2 point to the same object in memory.
In the third test, the sort order of arr1.sort() and arr2.sort() are the same; however, they still point to different objects in memory. Therefore, the third test evaluates to false.
Learn JavaScript™
Consider the following Set of objects spread into a new array. What gets logged?
const mySet = new Set([{ a: 1 }, { a: 1 } const result = [...mySet]; console.log(result);
const mySet = new Set([{ a: 1 }, { a: 1 } const result = [...mySet]; console.log(result);
Explanation:
While it's true a Set object will remove duplicates, the two values we create our Set with are references to different objects in memory, despite having identical key-value pairs. This is the same reason
It should be noted if the set was created using an object variable, say
While it's true a Set object will remove duplicates, the two values we create our Set with are references to different objects in memory, despite having identical key-value pairs. This is the same reason
{ a: 1 } === { a: 1 }
is false.It should be noted if the set was created using an object variable, say
obj = { a: 1 }
, new Set([ obj, obj ])
would have only one element, since both elements in the array reference the same object in memory.JavaScript Tip 💡
Did you know that you can use an empty 'placeholder' comma, to skip elements when destructuring arrays? #Javascripttip
Did you know that you can use an empty 'placeholder' comma, to skip elements when destructuring arrays? #Javascripttip
JavaScript Tip 💡
Use this one-liner to add leading zeros to numbers.
(Very useful for dates).#Javascripttip
Use this one-liner to add leading zeros to numbers.
(Very useful for dates).#Javascripttip