-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy path49_basic_terms_in_javascript.js
164 lines (81 loc) · 11.8 KB
/
49_basic_terms_in_javascript.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
// Here are some basic terms in JavaScript:
// Variable: A container for storing values, which can be a number, string, object, or other data type.
// Function: A block of code that performs a specific task and can be called multiple times throughout your code.
// Conditional statements: Statements that check a condition and execute different code depending on whether the condition is true or false.Examples include if/else statements and switch statements.
// Loops: Statements that execute a block of code repeatedly until a condition is met.Examples include for loops, while loops, and do -while loops.
// Objects: Collections of properties(key - value pairs) that represent a real - world object or concept.
// Arrays: Ordered collections of values, which can be of any data type.
// Strings: A sequence of characters, enclosed in quotation marks, that can be manipulated using various string methods.
// Numbers: Numeric values that can be manipulated using various math operators and methods.
// Boolean: A data type that can be either true or false, used for logical comparisons and conditional statements.
// Events: Actions that occur in the browser, such as clicking a button or submitting a form, which can be captured and responded to using event handlers.
// DOM(Document Object Model): The interface between JavaScript and HTML / CSS, allowing you to manipulate and interact with the contents of a web page.
// Scope: The context in which a variable or function is defined, determining where it can be accessed and manipulated within your code.
// Operators: Symbols used to perform operations on values or variables, such as + for addition or === for strict equality comparison.
// Methods: Functions that are associated with a particular object or data type, allowing you to perform specific actions or operations on that object.
// Classes: A template for creating objects, which encapsulate data and functionality in a single unit.
// Inheritance: The ability of an object to inherit properties and methods from a parent object, allowing you to create more specialized objects that share common functionality.
// Prototype: A way to add methods and properties to an object's constructor function, allowing those methods and properties to be shared among all instances of that object.
// Callbacks: Functions that are passed as arguments to other functions and executed at a later time, often used in asynchronous code.
// Promises: Objects that represent the eventual completion(or failure) of an asynchronous operation, allowing you to chain together multiple async operations and handle errors more easily.
// Modules: Self - contained units of code that can be imported and exported between different parts of your program, allowing you to organize your code and avoid naming conflicts.
// Arrow functions: A shorthand syntax for defining functions, using the => arrow operator to separate the function parameters from the function body.
// Template literals: A way to create strings using backticks(`) instead of quotation marks, allowing you to embed variables and expressions directly in the string using ${...} syntax.
// Spread operator: An operator(denoted by ...) that allows you to expand an array or object into individual elements, making it easier to pass them as arguments or combine them with other arrays / objects.
// Destructuring: A syntax for extracting values from arrays or objects and assigning them to variables in a more concise way.
// Async / await: A modern way of handling asynchronous code in JavaScript, allowing you to write code that looks more like synchronous code but still behaves asynchronously.
// Event loop: The mechanism by which JavaScript handles asynchronous operations, allowing it to run multiple tasks in parallel and respond to user input without blocking the main thread.
// Call stack: A data structure that tracks the order in which functions are called in your code, allowing JavaScript to know which function to return to when a function completes.
// Closure: A way of creating functions that can access variables from their parent function even after the parent function has completed execution.
// Hoisting: A behavior of JavaScript where variable and function declarations are moved to the top of their respective scopes, allowing them to be used before they are declared.
// Strict mode: A mode in JavaScript that enforces stricter rules for code quality and prohibits certain unsafe practices.
// Type coercion: The automatic conversion of one data type to another data type, which can sometimes lead to unexpected behavior in JavaScript.
// NaN: A special value in JavaScript that stands for "Not a Number", often returned by math - related operations that result in an undefined or non - numeric value.
// Truthy / falsy: A concept in JavaScript where certain values are considered "truthy"(i.e.they evaluate to true in a boolean context) and others are considered "falsy"(i.e.they evaluate to false in a boolean context).
// Scoping: The concept of how variables and functions are accessible within different parts of your code, often determined by where they are defined.
// Object - oriented programming(OOP): A programming paradigm that emphasizes the use of objects and classes to encapsulate data and behavior in a reusable way.
// Prototype: An object that serves as a template for other objects, allowing them to inherit properties and methods.
// Inheritance: The mechanism by which objects can inherit properties and methods from their parent objects.
// Encapsulation: The practice of grouping data and behavior together in a single unit(such as an object) to prevent direct external access to the data.
// Polymorphism: The ability of objects to take on multiple forms or behaviors, often achieved through inheritance and method overriding.
// Abstraction: The practice of hiding complex implementation details and exposing only the essential features of an object or function.
// Module: A self - contained unit of code that can be imported and used in other parts of your code, often used to organize and modularize larger codebases.
// Regular expression: A pattern - matching language used to search for and manipulate text in strings.
// Callback function: A function that is passed as an argument to another function and executed at a later time, often used to handle asynchronous operations.
// Promise: A JavaScript object representing the eventual completion(or failure) of an asynchronous operation and allowing for more structured handling of asynchronous code.
// Arrow function: A shorter and more concise syntax for defining functions in JavaScript, often used in functional programming and with higher - order functions.
// Spread syntax: A syntax for expanding an iterable(such as an array) into individual elements, often used for passing multiple arguments to a function or combining arrays.
// Rest parameter: A syntax for collecting multiple arguments into an array within a function, allowing for flexible function signatures.
// Template literal: A syntax for creating strings that allows for embedding expressions and variables within the string, making it easier to construct complex strings.
// Event: An action or occurrence that happens in the browser, such as a click, hover, or load event.
// Event listener: A function that is attached to an element and waits for a specific event to occur, triggering the execution of the function.
// DOM(Document Object Model): A tree - like representation of an HTML document that allows JavaScript to interact with and manipulate the elements and content of a webpage.
// Node: A single element in the DOM tree, such as an HTML tag or text node.
// Query selector: A method for selecting elements from the DOM based on CSS selectors, allowing for dynamic manipulation of the webpage.
// Async / await: A newer syntax for handling asynchronous operations in JavaScript, allowing for more readable and synchronous - like code.
// Promisify: A technique for converting callback - based functions into promise - based functions, allowing for easier handling of asynchronous operations.
// Closure: A function that has access to variables from its outer(enclosing) function, allowing for private variables and encapsulation of behavior.
// IIFE(Immediately Invoked Function Expression): A function that is executed as soon as it is defined, often used for encapsulation and preventing global variable pollution.
// Hoisting: A behavior in JavaScript where function and variable declarations are moved to the top of their scope, allowing them to be used before they are declared.
// Strict mode: A mode in JavaScript that enables stricter syntax rules and disallows certain actions(such as undeclared variables), helping to prevent errors and encourage best practices.
// Prototype chain: The chain of prototype objects that an object inherits from, allowing for inheritance and method resolution.
// Constructor function: A function that is used to create and initialize objects with the same structure and behavior, often used with the "new" keyword.
// Class: A newer syntax in JavaScript for creating constructor functions and organizing code into reusable and modular components.
// Inheritance: The ability for an object to inherit properties and methods from a parent object, allowing for code reuse and abstraction.
// Polymorphism: The ability for an object to take on different forms and behaviors depending on its context, often used with inheritance.
// Callback function: A function that is passed as an argument to another function and executed when the first function is finished, often used with asynchronous operations.
// Higher - order function: A function that takes another function as an argument or returns a function as its result, allowing for functional programming techniques.
// Arrow function: A newer syntax for defining functions with a shorter and more concise syntax, often used with higher - order functions and event listeners.
// Template literal: A newer syntax for creating strings with interpolated values and expressions, using backticks instead of quotes.
// Spread syntax: A newer syntax for spreading the elements of an array or object into another array or object, often used for copying and merging.
// Destructuring assignment: A newer syntax for extracting values from arrays and objects into individual variables, allowing for more concise and readable code.
// Error handling: The process of detecting, reporting, and handling errors in a program, often done using try-catch blocks or other error - handling techniques.
// Regular expression: A pattern used to match and manipulate strings based on specific criteria, often used for validation, parsing, and searching.
// Module: A self - contained unit of code that can be imported and used in other parts of a program, often used for organizing and encapsulating code.
// Asynchronous programming: A programming paradigm that allows for non - blocking and parallel execution of tasks, often used with event listeners, promises, and async / await.
// Promise: An object representing a value that may not be available yet, often used with asynchronous operations to handle success and error cases.
// Closure: A function and its associated environment, allowing for private variables and encapsulation of code.
// IIFE(Immediately Invoked Function Expression): A function that is immediately executed upon definition, often used for encapsulation and avoiding global scope pollution.
// DOM(Document Object Model): A representation of the HTML document as a hierarchical tree structure, allowing for manipulation and interaction with HTML elements and attributes.
// Babel: A tool for transpiling modern JavaScript code into backwards - compatible code that can run on older browsers and environments.
// Webpack: A tool for bundling and optimizing JavaScript code and other assets, often used with modern web development workflows.