-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjs-day1.txt
More file actions
63 lines (47 loc) · 3.5 KB
/
js-day1.txt
File metadata and controls
63 lines (47 loc) · 3.5 KB
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
1. Write a blog on Difference between HTTP1.1 vs HTTP2
------------------------------------------------------
HTTP:
----
* HTTP stands for hypertext transfer protocol & it is used in client-server communication.
* It is the foundation of data communication for the World Wide Web.
* By using HTTP user sends the request to the server & the server sends the response to the user.
---------------------------------------------------|-------------------------------------------------------
HTTP1.1 | HTTP2
---------------------------------------------------|-------------------------------------------------------
|
* HTTP1.1 was created in 1997. | * HTTP2 was created in 2015.
|
* It works on the textual format. | * It works on the binary protocol.
|
* HTTP1.1 is slower than HTTP2 | * HTTP2 is much faster and more reliable than HTTP1.
|
* There is head of line blocking that blocks | * It allows multiplexing so one TCP connection
all the requests behind it until it doesn’t get | is required for multiple request.
its all resources. |
|
* It uses requests resource Inlining for use | * It uses PUSH frame by server that collects
getting multiple pages. | all multiple pages.
|
* Expands on the caching support by using | * It is does not change much in terms of caching.
additional headers like cache-control. |
|
* It compresses data by itself. | * It uses HPACK for data compression.
------------------------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------------------------------------------------------------------------
2. Write a blog about objects and its internal representation in Javascript
---------------------------------------------------------------------------
Object in JavaScript:
---------------------
* In JavaScript, almost "everything" is an object.
* Objects in programming can be a combination of variables, functions, and data structures.
* Objects are more complex and each object may contain any combination of these primitive data-types as well as reference data-types.
* A JavaScript object is a collection of named values.
* Object values are written as key : value pairs inside curly braces {}.
* an example of a JavaScript Object:
----------------------------------
let myCup = {color: "transparent", volume: 1, weight: 0.5}
variablename -> mycup ;
key -> color, volume , weight ;
value -> "transparent" , 1 , 0.5 ;
if i called method -> console.log(myCup) = {color: "transparent", volume: 1, weight: 0.5}
* finally objects are adding and also change the values.