- This repository will help every js frontend-backend developer and beginners are very helpful. This repository is coming with beginners in mind.
বাংলায় পড়ুন
- এই repository প্রত্যেক js ফ্রন্টএন্ড-ব্যাকএন্ড Developer দের কিছুটা সহযোগিতা করতে পারে ।
- Everything will be upgraded over time. if you feel there is a problem then share it with me and I will implement it.
- মডিউল অনুসারে এই রিপোটি আপডেট হতে থাকবে এবং এই রিপোতে যদি কোন ভূল থাকে অবশ্যই আমার সাথে শেয়ার করতে পারেন ।
- introduced-to-js-17
- JavaScript-Array-Condition-18
- loops-practice-problems-19
- js-function-object-20
- apply-js-concept-21
- JavaScript-dom-25
- javaScript-ES6-31
- more-Javascript-ES6-32
- JavaScript-Api-33
- explore-Javascript-object-36
- Javascript-concept-39
- debugging-practice-40
CLICK FOR INTERVIEW QUESTIONS
//Basic knowledge
1. how does internet work?
//ES6 Interview Questions?
// Milestone 6: Intermediate JavaScript, Api
//module:
2. what is DOM?
3. What are the different ways to get an element from DOM ?
4. What's the different between an Event Handler and an Event Listener ?
5. what does "event bubbling" mean in JavaScript?
6. Can you explain the different types of events available in javaScript?
7. what's the difference bettween event.preventDefault() and event.stopPropagation()?
//module:
8. what's the diffrence between map,foreach, filter?
9. what's the diffrence between filter & find?
10. what's the diffrence for of and for in?
11. how do you empty an array?
12. Difference between class and object?
//module:
13. what is an api?
Ans: i. Api stands for Application Programming Interface.
ii. An API acts like a link that allows two applications to talk to each other.
iii. API is the part of the server that receives requests and sends responses
14. GET Vs POST ?
15. what are the HTTP methods supported by RESt?
16. Can you use GET request instead of PUT to create a resource?
17. what is JSON?
18. What are CRUD operations?
//module:
মাইলস্টোন ৬ টেকএওয়ে
এই মাইলস্টোন থেকে তুমি যদি আটটা জিনিস শিখতে চাও তাহলে নিচের এই আটটি জিনিস আরেকবার ভালো করে দেখে নাও-
19. fetch বা async await ইউজ করে API থেকে কিভাবে ডাটা লোড করতে হয়। ডাটা অনেক সময় অনেকভাবে থাকে। সেই ডাটা কোনটা কখন array কখন অবজেক্ট এর ভিতরে আছে। সেটা বুঝে সেই অনুসারে ডাটা দেখানোর সিস্টেম
20. arrow ফাংশন কিভাবে ইউজ করা হয়
21. template string এ ডাইনামিকভাবে কিভাবে ডাটা যোগ করতে হয়
22. map, forEach, filter, find এইগুলা কখন কোনটা ব্যবহার করতে হয়, এদের মধ্যে পার্থক্য কি
23. let, const, var এদের মধ্যে ডিফারেন্স কি, কোন কোনটা ইউজ করতে হয়।
24. কোনটা দিয়ে array এর মধ্যে লুপ করতে হয়, কোনটা দিয়ে অবজেক্ট এর মধ্যে লুপ করতে হয়
25. spread কিভাবে ইউজ করা হয়, স্প্রেড অপারেটর দিয়ে কিভাবে array কপি করে ফেলে।
26. ES6 এর মধ্যে কিভাবে অবজেক্ট বা array এর destructure করে সেটা থেকে ভেরিয়েবল ডিক্লেয়ার করতে হয়।
.
Milestone : 6 এই মাইলস্টোন থেকে তুমি যদি আরো চারটা জিনিস এ খেয়াল রাখতে চাও তাহলে সেগুলো হবে-
27. GET আর POST এর মধ্যে পার্থক্য কি ?
28. class আর অবজেক্ট কি জিনিস
29. bind, call, apply এর পার্থক্য কি ?
30. জাভাস্ক্রিপ্ট এর this সম্পর্কে ধারণা
// Milestone 7: Explore Browser & Debug
//module:
31. what is internet?
ans:i. The internet, sometimes called simply the net is a wold wide system of computer networkd
ii. a net work of networks in which user at any one computer can, if they have permission, get information from any other computer
iii. and sometimes talk directly to users at other computers.
32. What is IP address?
Ans: An IP address is a unique address that identifies a device on the internet or a local network.
33. What is HTTP?
Ans: https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview
34. What is an SSL certificate?
35. What is diffrence HTTP and HTTPS and HTTP version 4 ?
36. What is V8 Engine?
37. Asynchronous vs Synchronous and promise?
38. How to make Asynchronous JavaScript?
Ans: 3 way to make JavaScript asynchronous, we can to use
i. Callback functions (setTImeout, etc)
ii. Promises (fetch)
iii. Async/ await
39. What is single-threaded?
Ans: JavaScript is a single- threaded and synchronus language. (কিন্তু code Browser চলে আসে তখন সে asynchronous)
40. What do you mean by Synchronous?
41. What do you mean by asynchronous?
42. What is Promise?
43. what is the difference setInterval and clearInterval?
44. what the heck is the event loop anyway? philip robets
45. How does browser runs JavaScript?
46. How does Browser works?
47. Tell me something about JS engine v8 internal mechanism?
48. What is rerender in Browser?
49. What is event loop in JavaScript?
50. if javascript is single threaded, how does it handle asynchronous call?
51. What is SSL?
52. What is Regular Expression?
//module:
53. What is the defference between an alert box and a confirmation box?
54. What are javaScript Cookies?
55. Difference between local storage and sesseion storage?
56. what should you use? cookie or local storage or sesseion storage?
57. Tell me 2 differences between DOM vs BOM?
58. Can you discuss the types of broweserAPI?
59. what is javaScript Heap? (javaScript memory location কোথাই করে?)
Ans: কোন object/ array এর refarence টাকে কিছু সময়ের জন্য stored করে রাখে। সেটাই হল Heeap| javaScript এ memory location Heap এ করে।
60. what is javaScript stack?
Ans:
//module: (interview important)
61. what are the differences between double equal (==) vs triple equal (===)?
Ans:i. == check the value, and === check the value and type. এটাকে type coercion বলে বা type conversion বলে।
ii. === check the value and type . == দুইটা যদি same type এর হই তাহলে সরাসরি value টাকে check করবে. আর diffrent type এর হলে type টাকে convert করে check করে। এটাকে type coercion বলে বা type conversion বলে।
62. What is Hoisting in javaScript?
Ans:i. variable declear var দিয়ে করলে উপরে নিয়া যায়। function এর expresion লিখলে শুধু ওইটা নেই body টাকে নেই না। সেই জন্য var use না করে let, const use করতে হবে।
ii. Hoisting is javaScript default behavior of moving all declarations to the top of the current scope. only function delclarations are hoisted in javascript, function expressions are not hoisted. javascript only hoist declarations, not initializations.
63. Tell the difference Between Primitive and Non-Primitive Data types in javaScript?
64. What are the Truthy and Falsy Values? give me some examples.
65. What is the difference between null and undefined? (important)
66. What is scope in javaScript?
67. Define Block scope and global scope?
68. How to use the javaScript callback function?
69. Explain closure in JavaScript?
70. Explain passed by value and passed by reference?
2. What is DOM?
DOM stands for Document Object Model. It's a programming interface for web documents. In simpler terms, it's a way for programs to interact with the structure, style, and content of HTML, XML, or XHTML documents. It represents the document as a tree of objects where each object corresponds to a part of the document.
3. What are the different ways to get an element from DOM?
There are various ways to get an element from the DOM:
getElementById
: Gets an element by its ID.getElementsByClassName
: Gets elements by their class name.getElementsByTagName
: Gets elements by their tag name.querySelector
: Gets the first element that matches a CSS selector.querySelectorAll
: Gets all elements that match a CSS selector.
4. What's the difference between an Event Handler and an Event Listener?
An event handler is a function that handles a specific type of event. It can be an attribute in HTML or a property in JavaScript. An event listener, on the other hand, is a more flexible way to handle events. It is set up using the addEventListener
method in JavaScript and allows multiple functions to be executed for a particular event.
5. What does "event bubbling" mean in JavaScript? Event bubbling in JavaScript is like a ripple effect in water. When something happens (like a click) on an element, the effect bubbles up through its parent elements in the HTML structure. So, if you click on a button inside a div, the click event is noticed not just by the button but also by the div and any other ancestor elements all the way up to the document level.
Event bubbling is the process where the event starts from the target element and bubbles up through its ancestors in the DOM hierarchy. This means that if an event occurs on a nested element, it will also trigger event handlers on its parent elements, all the way up to the root of the document.
6. Can you explain the different types of events available in JavaScript?
There are various types of events in JavaScript, including:
- Mouse events (e.g., click, mouseover)
- Keyboard events (e.g., keydown, keyup)
- Form events (e.g., submit, change)
- Document/Window events (e.g., load, resize)
- Focus events (e.g., focus, blur)
7. What's the difference between event.preventDefault()
and event.stopPropagation()
?
-
event.preventDefault()
: This method is used to prevent the default action of an event. For example, preventing a form from submitting or a link from navigating to a new page. -
event.stopPropagation()
: This method stops the event from propagating or "bubbling" up or down the DOM hierarchy. It prevents the event from triggering event listeners on parent or child elements.
8. What's the difference between map, forEach, filter?
-
map
: It creates a new array by applying a function to each element of the original array. It doesn't change the original array. -
forEach
: It executes a provided function once for each array element. It's used for its side effects and doesn't create a new array. -
filter
: It creates a new array with only the elements that pass a certain condition, based on a provided function.
9. What's the difference between filter & find?
-
filter
: It returns a new array with all elements that satisfy a provided condition. -
find
: It returns the first element in the array that satisfies a provided condition. It returns a single element, not an array.
10. What's the difference between for...of and for...in?
-
for...of
: Used to iterate over the values of an iterable object (arrays, strings, etc.), providing the actual values. -
for...in
: Used to iterate over the enumerable properties of an object (including inherited ones), providing the property names.
11. How do you empty an array?
You can empty an array by setting its length to 0:
myArray.length = 0;
12. Difference between class and object?
-
Class
: It is a blueprint or a template for creating objects. It defines properties and methods that an object created from the class will have. -
Object
: An instance of a class. It's a concrete entity created from a class and represents a real-world thing. Objects have properties and methods defined by their class.
13. What is an API?
i. API stands for Application Programming Interface. ii. An API acts like a link that allows two applications to talk to each other. iii. API is the part of the server that receives requests and sends responses.
14. GET Vs POST?
-
GET: Used to request data from a specified resource. Data is sent in the URL, and there are restrictions on the amount of data that can be sent.
-
POST: Used to submit data to be processed to a specified resource. Data is sent in the request body, allowing for larger amounts of data.
15. What are the HTTP methods supported by REST?
Common HTTP methods used in REST are:
- GET: Retrieve data from a resource.
- POST: Create a new resource.
- PUT: Update a resource or create a resource if it doesn't exist.
- DELETE: Remove a resource.
- PATCH: Update a resource partially.
16. Can you use GET request instead of PUT to create a resource?
No, it's not recommended. The standard practice is to use POST to create a resource and PUT to update a resource. GET is generally used for retrieving data.
17. What is JSON?
JSON stands for JavaScript Object Notation. It's a lightweight data-interchange format that is easy for humans to read and write, and easy for machines to parse and generate. It's often used to transmit data between a server and a web application, as an alternative to XML.
18. What are CRUD operations?
CRUD stands for Create, Read, Update, and Delete. These are the basic operations that can be performed on data.
- Create: Add new data.
- Read: Retrieve data.
- Update: Modify existing data.
- Delete: Remove data.
31. What is the internet?
The internet is a big network of connected computers all around the world. It allows people to share information and communicate with each other.
32. What is an IP address? An IP address is like a home address for your computer on the internet. It's a unique set of numbers that identifies your device and allows it to communicate with other devices on the internet.
33. What is HTTP?
HTTP stands for Hypertext Transfer Protocol. It's the set of rules for transferring files, like text, images, and videos, on the internet. It's the foundation of any data exchange on the Web.
34. What is an SSL certificate?
An SSL certificate is like a digital passport for a website. It helps to keep the information exchanged between a user's browser and the website secure. It's especially important for websites that handle sensitive information like login credentials or payment details.
35. What is the difference between HTTP and HTTPS and HTTP version 4?
-
HTTP is the standard protocol for transferring data on the web.
-
HTTPS is a secure version of HTTP. It encrypts the data being transferred, adding an extra layer of security.
-
There isn't a specific "HTTP version 4." The latest major version of HTTP is HTTP/2, which is designed to be faster and more efficient than its predecessors.
36. What is the V8 Engine?
The V8 Engine is a JavaScript engine developed by Google. It's used in web browsers like Chrome to execute JavaScript code quickly and efficiently.
37. Asynchronous vs Synchronous and promise?
-
Synchronous: Things happen one after another. You wait for one thing to finish before starting the next.
-
Asynchronous: Things can happen independently. You don't have to wait; you can move on to the next thing.
-
Promise: It's like a promise to do something once a task is completed. It helps manage asynchronous operations in a more organized way.
38. How to make Asynchronous JavaScript?
You can make JavaScript asynchronous using techniques like callbacks, promises, and async/await. These help manage the flow of your code when dealing with operations that take time, like fetching data from a server.
39. What is single-threaded?
Single-threaded means that JavaScript processes one task at a time. It goes through one instruction after another, which makes it easier to understand but may lead to performance issues for tasks that take a long time.
40. What do you mean by Synchronous?
Synchronous means things happen one after another in a sequential order. Each task must finish before the next one starts.
41. What do you mean by Asynchronous?
Asynchronous means things can happen independently. You don't have to wait for one task to finish before starting the next one.
42. What is Promise?
A Promise is a way to handle asynchronous operations in JavaScript. It represents a value that might be available now, or in the future, or never. It helps manage the flow of asynchronous code more easily.
43. What is the difference between setInterval and clearInterval?
-
setInterval: It's a function used to repeatedly execute a function or code snippet at a specified interval.
-
clearInterval: It's a function used to stop the execution of code that was set up using
setInterval
.
44. What the heck is the event loop anyway? (Philip Roberts)
The event loop is a concept in JavaScript that handles asynchronous operations. It continuously checks the message queue for new tasks, executes them one by one, and repeats the process. Philip Roberts has a great talk explaining this concept in detail.
45. How does the browser run JavaScript?
The browser runs JavaScript using a JavaScript engine (like V8 in Chrome). When a web page is loaded, the browser parses and interprets the JavaScript code, executing it line by line.
46. How does the browser work?
The browser retrieves and displays web content. It interprets HTML, CSS, and JavaScript, then renders them to show the web page. It also manages things like user input, cookies, and network requests.
47. Tell me something about JS engine V8 internal mechanism?
The V8 Engine compiles JavaScript code to machine code for faster execution. It consists of two main components: the memory heap (for storing variables) and the call stack (for keeping track of function calls).
48. What is rerender in the browser? Rerender refers to the process of updating the displayed content on a webpage. When there's a change in data or state, the browser re-renders the affected part of the page to reflect the updated information.
49. What is the event loop in JavaScript?
The event loop is a mechanism that allows asynchronous JavaScript code to execute in a non-blocking way. It continuously checks the message queue for tasks, executes them, and goes back to checking for more tasks.
50. If JavaScript is single-threaded, how does it handle asynchronous calls?
JavaScript uses concepts like callbacks, promises, and async/await to handle asynchronous calls. These mechanisms allow the program to continue running other tasks while waiting for asynchronous operations to complete.
51. What is SSL?
SSL stands for Secure Sockets Layer. It's a protocol that ensures that the data exchanged between a user's browser and a website remains encrypted and secure.
52. What is Regular Expression?
A Regular Expression is a sequence of characters that forms a search pattern. It's often used for string matching, searching, and manipulation based on a defined pattern.
53. What is the difference between an alert box and a confirmation box?
-
Alert Box: It displays a message to the user with an OK button. It's mainly used for informational purposes.
-
Confirmation Box: It asks the user to confirm or cancel an action. It contains OK and Cancel buttons, and it's often used for user input.
54. What are JavaScript Cookies?
JavaScript Cookies are small pieces of data stored on the user's browser. They are often used to remember information about the user, such as login credentials or user preferences.
55. Difference between local storage and session storage?
-
Local Storage: Data stored in local storage persists even when the browser is closed and reopened. It has a longer lifespan.
-
Session Storage: Data stored in session storage only lasts for the duration of the page session. It is cleared when the browser or tab is closed.
56. What should you use? Cookie or Local Storage or Session Storage? It depends on the use case:
-
Use Cookies for small amounts of data that need to be sent back and forth with each request.
-
Use Local Storage for larger amounts of data that need to persist across browser sessions.
-
Use Session Storage for temporary data that should be cleared when the page session ends.
57. Tell me 2 differences between DOM vs BOM?
-
DOM (Document Object Model): It represents the structure of a document as a tree of objects. It deals with the document's content.
-
BOM (Browser Object Model): It represents the browser as a whole and provides objects like
window
andnavigator
. It deals with the browser's features and behavior.
58. Can you discuss the types of browser API?
Browser APIs include:
-
DOM API: Manipulates the structure of the document.
-
Geolocation API: Provides location information of the user's device.
-
Canvas API: Allows drawing graphics using JavaScript.
-
XHR (XMLHttpRequest) API: Enables making HTTP requests.
59. What is JavaScript Heap?
JavaScript Heap is a memory location where JavaScript stores references to objects or arrays for a certain period. It holds the data that is not immediately needed but may be used later.
60. What is JavaScript Stack?
JavaScript Stack is a memory location that keeps track of function calls and executes them in a Last In, First Out (LIFO) order. It's where the execution context and local variables are stored during function calls.
61. Differences between double equal (==) vs triple equal (===)?
i. == checks the value, and === checks both the value and the type. It's called type coercion. ii. === checks both the value and the type. == converts types if they are different.
62. What is Hoisting in JavaScript?
i. Variables declared with var
are hoisted to the top of their scope.
ii. Function declarations are fully hoisted, including the function body.
iii. Hoisting means moving declarations to the top, but not the initializations.
63. Difference Between Primitive and Non-Primitive Data types in JavaScript?
i. Primitive types are simple data types like numbers, strings, and booleans. ii. Non-primitive types (objects) include arrays, functions, and objects. They are more complex and can hold multiple values.
64. What are Truthy and Falsy Values?
i. Truthy values: Values that are considered true in a boolean context, like true
, non-empty strings, and numbers other than 0.
ii. Falsy values: Values that are considered false, like false
, null
, undefined
, 0, NaN, and empty strings.
65. Difference between null and undefined?
-
Null: It is a value that represents the intentional absence of any object value.
-
Undefined: It is a variable that has been declared but has not yet been assigned a value.
66. What is scope in JavaScript?
Scope refers to the context in which variables are declared and accessed. It determines the visibility and lifetime of variables.
67. Define Block scope and global scope?
-
Block Scope: Variables declared within a block (inside curly braces) are only accessible within that block.
-
Global Scope: Variables declared outside any function or block are accessible throughout the entire program.
68. How to use the JavaScript callback function?
A callback function is a function passed as an argument to another function, which is then invoked inside the outer function. It's often used for asynchronous operations.
69. Explain closure in JavaScript?
Closure is when a function "closes over" its surrounding state, capturing and remembering the values of the variables in its lexical scope even after the function has finished running.
70. Explain passed by value and passed by reference?
-
Passed by Value: Primitive data types (like numbers and strings) are passed by value. Changes made inside a function do not affect the original value.
-
Passed by Reference: Objects (including arrays and functions) are passed by reference. Changes made inside a function affect the original object because the reference to the object is passed.
<!-- row 24-->
<tr>
<th>24</th>
<td> </td>
<td> </td>
</tr>
<tr>
<th>24</th>
<td> </td>
<td> </td>
</tr>
</tbody>
Name | Answer | |
---|---|---|
1.17 | JSON.parse() | javaScript এর কোন একটি object/array/value কে Object a convert করার জন্য JSON.stringify() দিতে হবে (return Object;) |
1.18 | JSON.stringify() | JavaScript এর `JSON.stringify()` মেথড ব্যবহার করে কোন অবজেক্ট, অ্যারে, বা মানকে JSON স্ট্রিং এ রূপান্তর করা যায়। এই মেথডটি একটি অবজেক্টের ডাটা স্ট্রাকচার কে JSON ফরম্যাটে রূপান্তর করে এবং সেই স্ট্রিংকে রিটার্ন করে। |
1.19 | es6 update | 1. let and const, 2. default parameters, 3. template String, 4. arrow function, 5. Spread Operator, 6. destructuring |
1.20 | integer | পূর্ণ সংখ্যা 1, 2, 40, 43 [parseint()] |
2 | float | ভগ্নাংশ সংখ্যা decimal: 2.3, 43.23, 54.4 [parsefloat()] |
3 | ==, === | == check the value, and === check the value and typeof |
3 | let price1 = price1 + 10 | let price1 +=10 |
3 | let price1 = price1 - 10 | let price1 -=10 |
3 | let price1 = price1 * 10 | let price1 *=10 |
3 | let price1 = price1 / 10 | let price1 /=10 |
3 | Data Type | Premitive Data Type, Non Premitive Data Type |
8 | Premitive Data Type | Number, String, Undefined, Null, Boolean |
9 | Non Premitive Data Type | Object, Array, Function |
10 | Variable | declare, naming convention, variable types, primitive, math operations. |
10 | Factorial | A factorial is a function that multiplies a number by ev ery number below it till 1. |
10 | Conditionals | comparison: >, <, >=, <=, ===, !==, if-else |
14 | Array | Declare, index, get values, set values, indexOf, push, pop |
14 | Loop | for loop, while loop, break, continue |
15 | Function | declare, parameters, return, call, use the returned value from a function |
16 | Objeect | declare, properties, keys , values, get prop value, set value, loop object. |
17 | String | String হচ্ছে imutable. এর মান বা value change করা যাই না. |
18 | String | Apply Search includes, indexOf, startswith, endswith |
18 | destructing two way (valriable value swap) | Array to Array /* [first, second] = [second, first] */, Object to Object |
18 | Array Check | //check array using Array.isArray | console.log(Array.isArray(friends)) |
18 | Array Name Check (ase ki na) | const friends = [13, 14, 11, 17, 21, 16, 15, 20]; | console.log(friends.includes(19)) |
18 | preventDefault | e.preventDefault(); |
17 | Math | Math, abs, pow, round, ceil, floor, and random number |
19 | Math.random() | Math.random((Math.random()*1000)) // output 0.7895253939768327 |
20 | Math.round() | Math.round((Math.random()*10000)) // output 4492 |
19 | SELECT | function er vitor this diya mane oi tai select kora |
22 | Date | const today = new Date() |
23 | multiline | const multiline = 'line 1 \n' + ' line 2 \n' |
24 | Api GET | Receive Information about an API resource () |
24 | Api POST | Create an API resource (নতুন একটা কিছু add করা) |
24 | Api PUT/PATCH | Update an Api resource (put almost patch but put => যদি কোন কিছু আগে থেকেই থাকে সেইটা পরিবর্তন করে নিজে বসে পরে। আর না থাকলে নিজে create করে ) (patch => কোন কিছু আগে থেকেই আছে সেই টা update করে) patch করতে হলে কিছু থাকতে হবে। |
24 | Api DELETE | Delete an API resource (Api থেকে কিছু delete করতে DELETE method করতে হবে) |
24 | Api CRUD | ' |
24 | HTTP STATUS CODE | (200 - ok), (301 - Moved Permanently), (302- Moved Temporarily), (404 - Not Found), (500 - Intenal Server Error), (503 - Service Unabailable) |
24 | setTimeout() | For clearing the timeout funtion, clearTimeout() is used |
24 | setTimeout() | For clearing the timeout funtion, clearInterval() is used |
24 | event loop | JavaScript এর asynchronous items গুলা থাকে Queue-তে এবং synchronous items গুলা থাকে Stack-এ। Stack এর কাজগুলা সম্পাদন হয়ে গেলে তখন Queue-তে থাকা কাজগুলো Stack-এ এসে সম্পাদন হতে থাকে। আর এই পুরো কাজটা Event Loop-এর মাধ্যমে হয়ে থাকে। এটাই event loop এর কন্সেপ্ট |
24 | Call Stack | Call Stack হচ্ছে Stack এর মধ্যে synchronous ভাবে যেই function এর কাজগুলো একটার পর একটা থাকে এবং সেই অনুসারে execute হয়, সেটাকেই call stack বলে |
24 | Edit any ui page | document.body.contentEditable = true |
24 | get cookie value from browser | document.cookie |
24 | get cookie value as array | document.cookie.split('; ') |
24 | get cookie value in key-value pair | document.cookie.split('; ').map(c => console.log(c)) |
{
// Example:
"Print to console": {
"prefix": "cl",
"body": [
"console.log($1)"
],
"description": "Log output to console"
},
"Print to console.error": {
"prefix": "ce",
"body": [
"console.error($1)"
],
"description": "Log output to console"
},
"Print to const": {
"prefix": "cn",
"body": [
"const $1 = $2;",
"$3"
],
"description": "Log output to const"
},
"Print to const function": {
"prefix": "cf",
"body": [
"const $1 = ($2) => {$3}",
"$4"
],
"description": "Log output to const function"
},
"Print to if": {
"prefix": "i",
"body": [
"if($1){$2}",
"$3"
],
"description": "Log output to if"
},
"Print to fetch": {
"prefix": "fet",
"body": [
"fetch('$1')",
".then(res => res.json())",
".then(data => $2)",
"$3"
],
"description": "Log output to fetch"
},
"Print to let": {
"prefix": "le",
"body": [
"let $1 = $2;",
"$3"
],
"description": "Log output to let"
},
}