# Objects

#  Window Object 
## 1. console
>1.   **assert()** - Writes an error message to the console if a assertion is false
>2. ** count() **- Logs the number of times that this particular call to count() has been called
>3. ** error()**	- Outputs an error message to the console
>4.  **group()**	- Creates a new inline group in the console. This indents following console messages by an additional level, until ```console.groupEnd()``` is called 
>5.  **info()** - Outputs an informational message to the console
>6.  **table()** -	Displays tabular data as a table
>7  **time(**)	- Starts a timer (can track how long an operation takes)
>8. ** timeEnd()** -	Stops a timer that was previously started by console.time()
>9. ** trace()** -  that show how the code ended up at a certain point.
>10.   **warn()** -Outputs a warning message to the console

> String substitutions** = Normally console output String so with string substitution we can show output a **Integer** (%d or %i), **javascript** Object(%o or %O), String, **Float**, and for **styling **use %c [more](https://developer.mozilla.org/en-US/docs/Web/API/Console)**

```
// Outputting multiple objects

const car = "Dodge Charger";
const someObject = { str: "Some text", id: 5 };
console.info("My first car was a", car, ". The object is:", someObject);

output - My first car was a Dodge Charger. The object is: {str:"Some text", id:5}
```

## 2. **Window History**
>1.** back()**....  2. **forward()**.....  3. **go()**..........	4. **length**	
> ```history.go(-1);     // equivalent to history.back();```
>
> **pushState()** - **replaceState()** will change the URL in the browser (ie. pressing the back button won't take you back) **[pushState()](https://developer.mozilla.org/en-US/docs/Web/API/History/pushState)** will change the URL, and keep the old one in the browser history
> 
>  **scrollRestoration ** - Jab back navigate karenge tak jaha par scroll kare hai wahi par wapis aaye

## 3.  Window Location
### Location Object Properties
  **Sets or return of URL** ![window location.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1668051653791/THW6NpsEc.png align="center")
### Location Object method
> 1. loaction.assign(newURL)......... 2. reload()........3. replace()	
> ***The difference between assign() and replace():-**
replace() removes the current URL from the document history.
With replace() it is not possible to use "back" to navigate back to the original document.*

## 4.  Navigator Object 
>1.  **product **- Returns browser engine name
>2.  **onLine	**- Returns true if the browser is online
>3.  **userAgent **-	Returns browser user-agent header
>4.  **appVersion **- Returns browser version
>5.  **cookieEnabled**......5.  **geolocation**....6.  **language**.....	7.  **platform**...... 8. **appCodeName **9.  **appName**..... 10.	**javaEnabled()**
> 11. **Navigator.credentials** - CredentialsContainer interface which exposes methods to request credentials and notify the user agent when interesting events occur such as successful sign in or sign out.
> 12. **Navigator.hardwareConcurrency** - Returns the number of logical processor cores available.
> 13. **Navigator.locks ** -  Returns a LockManager object that provides methods for requesting a new [Lock](https://developer.mozilla.org/en-US/docs/Web/API/Lock#examples)object and querying for an existing Lock object.
> 14. **Navigator.maxTouchPoints**.......... 15. **Navigator.mediaCapabilities**......... 16. 
**Navigator.mediaDevices**...... 17. **Navigator.mediaSession**....... 18. **Navigator.onLine**...... 19. **Navigator.pdfViewerEnabled**....... 20. **Navigator.permissions** ...... 
> 21. **Navigator.permissions ** - Returns a **Permissions **object that can be used to query and update permission status of APIs covered by the **[Permissions AP](https://developer.mozilla.org/en-US/docs/Web/API/Permissions_API#concepts_and_usage)I**....... 
> 22. **Navigator.serviceWorker ** - Returns a **[ServiceWorkerContainer](https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorkerContainer) **object, which provides access to registration, removal, upgrade, and communication .........
> 23. **[Navigator.storage](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/storage)** - Returns the singleton StorageManager object ..... 
> 24. **Navigator.webdriver**  - Indicates whether the user agent is controlled by automation......... 
> 25. **Navigator.windowControlsOverlay ** - Returns the [**WindowControlsOverlay *](https://developer.mozilla.org/en-US/docs/Web/API/Navigator/windowControlsOverlay)*interface which exposes information about the geometry of the title bar in desktop Progressive Web Apps, and an event to know whenever it changes..... 
> 26.** Navigator.canShare()**  - Returns true if a call to Navigator.share() would succeed………..
> 27. **Navigator.getBattery() **- Returns a promise that resolves with a BatteryManager object………..
> 28. Navigator.registerProtocolHandler()**** - Allows web sites to register themselves as a possible handler for a given protocol.………..
> 29. **Navigator.vibrate() **- Causes vibration on devices with support for it. Does nothing if vibration support isn't available.………..
> 30**. Navigator.requestMediaKeySystemAccess()** - Returns a Promise for a MediaKeySystemAccess object.………..
> 31. **Navigator.requestMIDIAccess() **- Returns a Promise representing a request for access to MIDI devices on the user's system.………..
> 32. **Navigator.sendBeacon() ** - Used to asynchronously transfer a small amount of data using HTTP from the User Agent to a web server.………..



## 5.  Window Screen
>1.  **availHeight**...........2.  **availWidth**...........3.  **colorDepth**.......4. **height**.........5.  **pixelDepth..........	**6. **width**	
> **Window.screenX ** - the horizontal distance, in CSS pixels, of the left border of the user's browser viewport to the left side of the screen. (**Window.screenY ** ) like - **screentop **and **screenleft**


