What is the difference between Call, Apply and Bind?
The difference between Call, Apply and Bind can be explained with examples,
Call: The call() method invokes a function with a given this value and arguments provided one by one!
Apply: Invokes the function with a given this value and allows you to pass in arguments as an array!
Bind: returns a new function, allowing you to pass any number of arguments!
Call and Apply are pretty interchangeable. Both execute the current function immediately. You need to decide whether itβs easier to send in an array or a comma separated list of arguments. You can remember by treating Call is for comma (separated list) and Apply is for Array.
Whereas Bind creates a new function that will have this set to the first parameter passed to bind()
Dictionary
@Diyorbekk_dev
The difference between Call, Apply and Bind can be explained with examples,
Call: The call() method invokes a function with a given this value and arguments provided one by one!
Apply: Invokes the function with a given this value and allows you to pass in arguments as an array!
Bind: returns a new function, allowing you to pass any number of arguments!
Call and Apply are pretty interchangeable. Both execute the current function immediately. You need to decide whether itβs easier to send in an array or a comma separated list of arguments. You can remember by treating Call is for comma (separated list) and Apply is for Array.
Whereas Bind creates a new function that will have this set to the first parameter passed to bind()
Dictionary
interchangeable - things that are interchangeable can be used instead of each other
@Diyorbekk_dev
β‘2π2
What is JSON and its common operations?
JSON is a text-based data format following JavaScript object syntax, which was popularized by Douglas Crockford. It is useful when you want to transmit data across a network and it is basically just a text file with an extension of .json, and a MIME type of application/json
Parsing: Converting a string to a native object
Stringification: converting a native object to a string so it can be transmitted across the network
βͺοΈ JSON is a lightweight data interchange format that is easy for humans to read and write and easy for machines to parse and generate.
βͺοΈ It is often used to transmit data between a server and web application, as well as to store configuration data.
βͺοΈ The data in JSON is represented as key-value pairs, similar to objects in JavaScript
@Diyorbekk_dev
JSON (JavaScript Object Notation)
JSON is a text-based data format following JavaScript object syntax, which was popularized by Douglas Crockford. It is useful when you want to transmit data across a network and it is basically just a text file with an extension of .json, and a MIME type of application/json
Parsing: Converting a string to a native object
JSON.parse(text);
Stringification: converting a native object to a string so it can be transmitted across the network
JSON.stringify(object);
βͺοΈ JSON is a lightweight data interchange format that is easy for humans to read and write and easy for machines to parse and generate.
βͺοΈ It is often used to transmit data between a server and web application, as well as to store configuration data.
βͺοΈ The data in JSON is represented as key-value pairs, similar to objects in JavaScript
@Diyorbekk_dev
π2
What is the purpose of the array slice method?
The slice() method in JavaScript is a powerful tool when working with arrays. Its main purpose is to extract a portion of an array and return it as a new array, without modifying the original array.
Selection of Elements:
The method takes one or two arguments. The first argument is the starting index from which elements will be selected.
The second argument (optional) is the ending index (exclusive) up to which elements will be selected. If this argument is not provided, the selection continues until the end of the array.
Creating a New Array:
The selected elements are then returned as a new array. This means that the original array remains unchanged.
Non-Destructive Operation:
Importantly, the slice() method does not modify the original array. This is crucial when you want to work with subsets of an array without altering the source data.
One Step ahead of the bestβ
@Diyorbekk_dev
The slice() method in JavaScript is a powerful tool when working with arrays. Its main purpose is to extract a portion of an array and return it as a new array, without modifying the original array.
Selection of Elements:
The method takes one or two arguments. The first argument is the starting index from which elements will be selected.
The second argument (optional) is the ending index (exclusive) up to which elements will be selected. If this argument is not provided, the selection continues until the end of the array.
Creating a New Array:
The selected elements are then returned as a new array. This means that the original array remains unchanged.
Non-Destructive Operation:
Importantly, the slice() method does not modify the original array. This is crucial when you want to work with subsets of an array without altering the source data.
One Step ahead of the bestβ
@Diyorbekk_dev
β‘1π1
π1
How do you compare Object and Map?
1) Keys:
Objects: Keys are limited to Strings and Symbols.
Maps: Keys can be any value, including functions, objects, and primitives.
2) Order:
Objects: Keys have no guaranteed order.
Maps: Keys are ordered based on insertion sequence.
3) Size:
Objects: Size must be determined manually.
Maps: Size can be easily obtained using the size property.
4) Iteration:
Objects: Require manual key extraction for iteration.
Maps: Are directly iterable.
5) Prototype:
Objects: Have a prototype, which may lead to unintended key collisions.
Maps: Provide a clean alternative without a prototype.
Performance:
6) Maps: May perform better in scenarios involving frequent addition and removal of key-value pairs.
In conclusion, Maps offer more flexibility, ordering, and ease of use, especially for scenarios involving iteration and frequent modifications.
One Step ahead of the bestβ
@Diyorbekk_dev
1) Keys:
Objects: Keys are limited to Strings and Symbols.
Maps: Keys can be any value, including functions, objects, and primitives.
2) Order:
Objects: Keys have no guaranteed order.
Maps: Keys are ordered based on insertion sequence.
3) Size:
Objects: Size must be determined manually.
Maps: Size can be easily obtained using the size property.
4) Iteration:
Objects: Require manual key extraction for iteration.
Maps: Are directly iterable.
5) Prototype:
Objects: Have a prototype, which may lead to unintended key collisions.
Maps: Provide a clean alternative without a prototype.
Performance:
6) Maps: May perform better in scenarios involving frequent addition and removal of key-value pairs.
In conclusion, Maps offer more flexibility, ordering, and ease of use, especially for scenarios involving iteration and frequent modifications.
One Step ahead of the bestβ
@Diyorbekk_dev
β‘1β1
What is the difference between == and === operators?
JavaScript provides both strict(===, !==) and type-converting(==, !=) equality comparison. The strict operators take type of variable in consideration, while non-strict operators make type correction/conversion based upon values of variables. The strict operators follow the below conditions for different types,
1) Two strings are strictly equal when they have the same sequence of characters, same length, and same characters in corresponding positions.
2) Two numbers are strictly equal when they are numerically equal. i.e, Having the same number value.
There are two special cases in this,
βͺοΈ NaN is not equal to anything, including NaN.
βͺοΈ Positive and negative zeros are equal to one another.
3) Two Boolean operands are strictly equal if both are true or both are false.
4) Two objects are strictly equal if they refer to the same Object.
5) Null and Undefined types are not equal with ===, but equal with ==. i.e, null===undefined --> false but null==undefined --> true
One Step ahead of the bestβ
@Diyorbekk_dev
JavaScript provides both strict(===, !==) and type-converting(==, !=) equality comparison. The strict operators take type of variable in consideration, while non-strict operators make type correction/conversion based upon values of variables. The strict operators follow the below conditions for different types,
1) Two strings are strictly equal when they have the same sequence of characters, same length, and same characters in corresponding positions.
2) Two numbers are strictly equal when they are numerically equal. i.e, Having the same number value.
There are two special cases in this,
βͺοΈ NaN is not equal to anything, including NaN.
βͺοΈ Positive and negative zeros are equal to one another.
3) Two Boolean operands are strictly equal if both are true or both are false.
4) Two objects are strictly equal if they refer to the same Object.
5) Null and Undefined types are not equal with ===, but equal with ==. i.e, null===undefined --> false but null==undefined --> true
One Step ahead of the bestβ
@Diyorbekk_dev
β€βπ₯1β1π1
It is the example for the previous post!
βοΈ Please, Note all information!
Possibly, We are gonna do interview from JavaScript with you!
@Diyorbekk_dev
βοΈ Please, Note all information!
Possibly, We are gonna do interview from JavaScript with you!
@Diyorbekk_dev
β€βπ₯7
What are lambda or arrow functions?
1) Shorter Syntax:
Arrow functions offer a compact syntax compared to function expressions.
2) No "this" Binding:
Arrow functions inherit the this value from the enclosing scope, eliminating their own this context.
3) No "arguments" or "super" Binding:
Arrow functions do not have their own arguments or super references.
4) Best for Non-Method Functions:
Well-suited for standalone functions, not ideal for object methods.
5) Implicit Return:
If the function body is a single expression, curly braces and return can be omitted.
6) No "new.target" Binding:
Arrow functions lack a new.target binding and cannot be used as constructors.
@Diyorbekk_dev
1) Shorter Syntax:
Arrow functions offer a compact syntax compared to function expressions.
2) No "this" Binding:
Arrow functions inherit the this value from the enclosing scope, eliminating their own this context.
3) No "arguments" or "super" Binding:
Arrow functions do not have their own arguments or super references.
4) Best for Non-Method Functions:
Well-suited for standalone functions, not ideal for object methods.
5) Implicit Return:
If the function body is a single expression, curly braces and return can be omitted.
6) No "new.target" Binding:
Arrow functions lack a new.target binding and cannot be used as constructors.
@Diyorbekk_dev
Module 1. Channel Contents
The First Step In JavaScript.
βββββββ
isNaN(Biladiganlar bormi?π )
βββββββ
toPrecision() in JavaScript?
βββββββ
~~ operator in JavaScirpt?
βββββββ
Truthy and Falsy elementlar
βββββββ
5 Scopes in JavaScript!
βββββββ
Array Methods!
βββββββ
"Trailling" or "Hanging" comma.
βββββββ
Memory management in JavaScript!
βββββββ
Asynchronous JavaScript (promises, callbacks, async/await)
βββββββ
reCuptcha
βββββββ
Feature-Sliced Design (FSD)
βββββββ
Git stash
βββββββ
What is Docker?
βββββββ
JavaScript info Books 1, 2, 3
βββββββ
Generator funktsiyalari!
βββββββ
Intl.NumberFormat
βββββββ
Absolute or Relative URLs?
βββββββ
(HOW JAVASCRIPT WORKS) EXECUTION CONTEXT!
βββββββ
JavaScript engine!
βββββββ
What are the possible ways to create objects in JavaScript?
βββββββ
What is a prototype chain?
βββββββ
What is the difference between Call, Apply and Bind?
βββββββ
What is JSON and its common operations?
βββββββ
What is the purpose of the array slice method?
βββββββ
What is the difference between slice and splice?
βββββββ
How do you compare Object and Map?
βββββββ
What is the difference between == and === operators?
βββββββ
What are lambda or arrow functions?
@Diyorbekk_dev
The First Step In JavaScript.
βββββββ
isNaN(Biladiganlar bormi?π )
βββββββ
toPrecision() in JavaScript?
βββββββ
~~ operator in JavaScirpt?
βββββββ
Truthy and Falsy elementlar
βββββββ
5 Scopes in JavaScript!
βββββββ
Array Methods!
βββββββ
"Trailling" or "Hanging" comma.
βββββββ
Memory management in JavaScript!
βββββββ
Asynchronous JavaScript (promises, callbacks, async/await)
βββββββ
reCuptcha
βββββββ
Feature-Sliced Design (FSD)
βββββββ
Git stash
βββββββ
What is Docker?
βββββββ
JavaScript info Books 1, 2, 3
βββββββ
Generator funktsiyalari!
βββββββ
Intl.NumberFormat
βββββββ
Absolute or Relative URLs?
βββββββ
(HOW JAVASCRIPT WORKS) EXECUTION CONTEXT!
βββββββ
JavaScript engine!
βββββββ
What are the possible ways to create objects in JavaScript?
βββββββ
What is a prototype chain?
βββββββ
What is the difference between Call, Apply and Bind?
βββββββ
What is JSON and its common operations?
βββββββ
What is the purpose of the array slice method?
βββββββ
What is the difference between slice and splice?
βββββββ
How do you compare Object and Map?
βββββββ
What is the difference between == and === operators?
βββββββ
What are lambda or arrow functions?
@Diyorbekk_dev
β‘2
Diyorbek.dev | π¨π»βπ»
Module 1. Channel Contents The First Step In JavaScript. βββββββ isNaN(Biladiganlar bormi?π ) βββββββ toPrecision() in JavaScript? βββββββ ~~ operator in JavaScirpt? βββββββ Truthy and Falsy elementlar βββββββ 5 Scopes in JavaScript! βββββββ Array Methods!β¦
Insha'alloh Ertadan 2 - Module boshlanadi!
Ikkinchi Moduleda endi sizlar ham ishtirok etishingiz mumkin!
Tartibi:
1) Jadval shakillantiramiz! (Qatnashuvchilar ism familyasi yoziladi!)
2) Harkim o'zi o'rganmoqchi va o'rgatmoqchi bo'lgan mavzularni yozib chiqadi!
3) Vaqtni kelishib olib muhokama qilamiz. (want to learn want to teach!)
4) 2 - Module dan keyin interview tashkillashtirish!
P.S: Iloji boricha active bo'lishga harakt qilinglar. Bu o'sishingiz uchun juda katta qadam bo'loladi. Interviewdan yaxshi o'tganlar va o'zini ko'rsatganlarga IQRO companyga offer olib beraman! π Bu bo'nus! Hozircha online shug'illanamiz, keyinchalik offline biror chiroyli joyda yig'lib discuss qilamiz barchasini! Startup loyihalarni boshlaymiz!
One Step ahead of the bestβ
@Diyorbekk_dev
Ikkinchi Moduleda endi sizlar ham ishtirok etishingiz mumkin!
Tartibi:
1) Jadval shakillantiramiz! (Qatnashuvchilar ism familyasi yoziladi!)
2) Harkim o'zi o'rganmoqchi va o'rgatmoqchi bo'lgan mavzularni yozib chiqadi!
3) Vaqtni kelishib olib muhokama qilamiz. (want to learn want to teach!)
4) 2 - Module dan keyin interview tashkillashtirish!
P.S: Iloji boricha active bo'lishga harakt qilinglar. Bu o'sishingiz uchun juda katta qadam bo'loladi. Interviewdan yaxshi o'tganlar va o'zini ko'rsatganlarga IQRO companyga offer olib beraman! π Bu bo'nus! Hozircha online shug'illanamiz, keyinchalik offline biror chiroyli joyda yig'lib discuss qilamiz barchasini! Startup loyihalarni boshlaymiz!
One Step ahead of the bestβ
@Diyorbekk_dev
π₯3π―2
What is a first class function?
In Javascript, functions are first class objects. First-class functions means when functions in that language are treated like any other variable.
For example, in such a language, a function can be passed as an argument to other functions, can be returned by another function and can be assigned as a value to a variable. For example, in the below example, handler functions assigned to a listener
Summary:
βͺοΈAssigned to variables.
βͺοΈPassed as arguments to other functions.
βͺοΈReturned from other functions.
@Diyorbekk_dev
In Javascript, functions are first class objects. First-class functions means when functions in that language are treated like any other variable.
For example, in such a language, a function can be passed as an argument to other functions, can be returned by another function and can be assigned as a value to a variable. For example, in the below example, handler functions assigned to a listener
const handler = () => console.log("This is a click handler function");
document.addEventListener("click", handler);
Summary:
βͺοΈAssigned to variables.
βͺοΈPassed as arguments to other functions.
βͺοΈReturned from other functions.
@Diyorbekk_dev
β€βπ₯1β‘1
Iβm happy to share that Iβve obtained a new certification: JavaScript Algorithms and Data Structures from freeCodeCamp!
Now your turn! π
@Diyorbekk_dev
Now your turn! π
@Diyorbekk_dev
π3
2-Modulni boshlaymiz!
1-qadamda qatnashuvchilar quyidagi listni namunadagidek toβldirishingiz kerak!
Oβrganmoqchi boβlgan mavzuyingizni yozasiz: Want to learn!
Oβrgatmoqchi boβlgan mavzuyingizni yozasiz: Want to teach!
Quyidagi listga barcha uchun access berilgan bemalol toβldirsangiz boβladi!
Mavzular toβldirilgandan soβng! Biror kunni rejalashtirib online suhbat qilamiz! Keyin esa bir birimizga oβrgatishni boshlaymiz!
https://docs.google.com/spreadsheets/d/1UMKMi4jX1Tg3bS6WC_9jCCi-ZmRcRjhRzzSVIQqpGwM/edit?usp=sharing
1-qadamda qatnashuvchilar quyidagi listni namunadagidek toβldirishingiz kerak!
Oβrganmoqchi boβlgan mavzuyingizni yozasiz: Want to learn!
Oβrgatmoqchi boβlgan mavzuyingizni yozasiz: Want to teach!
Quyidagi listga barcha uchun access berilgan bemalol toβldirsangiz boβladi!
Mavzular toβldirilgandan soβng! Biror kunni rejalashtirib online suhbat qilamiz! Keyin esa bir birimizga oβrgatishni boshlaymiz!
https://docs.google.com/spreadsheets/d/1UMKMi4jX1Tg3bS6WC_9jCCi-ZmRcRjhRzzSVIQqpGwM/edit?usp=sharing
Google Docs
Module 2
Sheet1
N,Full Name,Topic Name,Action,Date
1,Diyorbek Juraev,Promises, Promise.all, Promise.race, Promise.allSettled(), Promise.any(),Want to teach,6.12.2023
2, Abdug'affor Nishonov,about Dom | Dom manipulation ,want to teach/learn
3,Araqulov Umrzoq,functionsβ¦
N,Full Name,Topic Name,Action,Date
1,Diyorbek Juraev,Promises, Promise.all, Promise.race, Promise.allSettled(), Promise.any(),Want to teach,6.12.2023
2, Abdug'affor Nishonov,about Dom | Dom manipulation ,want to teach/learn
3,Araqulov Umrzoq,functionsβ¦
Diyorbek.dev | π¨π»βπ» pinned Β«2-Modulni boshlaymiz! 1-qadamda qatnashuvchilar quyidagi listni namunadagidek toβldirishingiz kerak! Oβrganmoqchi boβlgan mavzuyingizni yozasiz: Want to learn! Oβrgatmoqchi boβlgan mavzuyingizni yozasiz: Want to teach! Quyidagi listga barcha uchun accessβ¦Β»