You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Iteration and Hidden Properties: Properties keyed by symbols are not enumerable in for...in loops or Object.keys(), so they can be used to create "hidden" properties.
20
20
21
21
letobj={
22
-
[Symbol('hidden')]: 'secret',
23
-
name: 'public'
24
-
};
25
-
26
-
for(letkeyinobj){
27
-
console.log(key);// logs 'name', but not the Symbol property
28
-
}
22
+
[Symbol('hidden')]: 'secret',
23
+
name: 'public'
24
+
};
25
+
26
+
for(letkeyinobj){
27
+
console.log(key);// logs 'name', but not the Symbol property
A framework provides rules and regulations (or guidelines) that developers follow when building an application. These rules help ensure consistency, maintainability, and best practices. It often dictates how the overall structure of the application should be organized, as well as how different components (like data, user interfaces, and logic) should interact with each other.
2
+
3
+
In short, the framework sets up a foundation or blueprint for the developer to work within, but it often requires following its conventions to achieve the desired outcome efficiently.
4
+
5
+
A library is a collection of pre-built functions or modules that you can use to solve specific problems or perform tasks. When you use a library, you are calling specific pieces of functionality as needed, rather than following a structured set of rules like a framework.
6
+
7
+
For example, in JavaScript:
8
+
9
+
The Math library provides functions like Math.sqrt() or Math.random() to perform mathematical operations.
10
+
You use the functions or modules from the library when and where you need them, but you control the flow of the program.
11
+
So, the key difference is that:
12
+
13
+
A framework often dictates the structure of your application (it calls your code).
14
+
A library is something you call to use its functionality to solve a problem.
0 commit comments