You are on page 1of 7
5 Useful Web APlis (cree eg sor Clipboard API This API provides access to the operating system's clipboard. You can use it to build a copy button to copy/paste content. Orr cron const writeToClipboard = async () = { roa eUCMmIEUCeomaee eerste ica Or rar Ta eee Oar SOC eC CT Pecos os Pome CaciaH + i const readFromClipboard = async () > { a7 Seabee CC ARC ero Oe CEC Cab oto pec scao ee Pere erCsT To ul 7 yon ra Ds Tort Le) LocalStorage API It lets you store data against the website address in the form of key/value pairs. Local storage is limited to 5 MB. eee file bay // save data in local storage localStorage.setItem('key', ''); // get data from local storage localStorage.getItem('key'); // remove data from local storage localStorage.removeltem('key'); Saad Irfan < (onprev Ntsc le} Geolocation API This API provides the user’s geographical latitudes and longitudes and the accuracy to which it is correct. Ory od Career ucts tote OnE Dorrie asa une teeta nese CLG Pests ies CORE eae es Cs unta ac TE era eae oe Te Cece RE Leet COE Coast in clea CTE SECs eC EES aL a itp a eee eco es timeout: 5000, Deu) Saad Irfan < (onprev Ntsc le} History API This API lets you go back and forth between web pages that are in your session history. eee index.js On a ae eo a) window. history.back(); // go forward in history window. history. forward(); Saad Irfan < (onprev Ntsc le} =i Kol a WN >) | It is a browser API that lets you call REST APIs or GraphQL APIs. 7 ~ Cx x Titel ad async function callAPI() { cea const res = await fetch( API, { method: '', headers: {}, body: {}, 4); const data = await res.json(); Saot aba Loh led aoc nee t 5) nt console. log(err); a i Saad Irfan << FonpeMaN tense] “ 7 | Saad Irfan @DevwithSaad Did You Find it Useful? Share Your thoughts.

You might also like