In the case of primitive data types we copy by the value which means we assign a variable to another variable, its data is passed to another variable and both of them refer to unidentical memory locations.
in the case of composite data types we copy by reference we assign a variable to another variable, no new memory is allocated instead a reference is created which is pointed to the memory of the first variable.
To start off let us talk about the basic data types in javascript language there are classified as primitive and composite datatype
primitive data type consists of your integer float double boolean strings whereas composite or derived datatypes consist of arrays, objects, and functions
for eg if var a = 10; which denotes a simple primitives data type which stores a value of 10 in variable a which can be changed any time
arr =[10,20] refers not to the value stored in the array rather it points to the memory location so that in composite datatype copy by value isn't feasible so it's copied by reference using a spread operator
HTTP is based on the Client/Server model. The client/server model can be explained as two computers, the Client (receiver of service) and the Server (provider of service) that are communicating via requests and responses.
HTTP 2 was a revised version of HTTP 1 with the shear motto of improving the following feature over HTTP 1 there are as follows :
- page-load speeds
- compatibility with HTTP 1
- binary protocol
- requesting multiplexing over a single TCP connection
HTTP can send multiple requests over a single TCP connection which allows us to download multiple files from the single server asynchronously
Header compression allows us to compress large redundant header frame
HTTP 1 uses text protocol to send a request whereas http2 uses the binary protocol to send the request