FrontEndQuestions
FrontEndQuestions
HTML/CSS
• What is DOCTYPE?
The <!DOCTYPE> declaration represents the document type, and helps browsers
to display web pages correctly.
It must only appear once, at the top of the page (before any HTML tags).
<!DOCTYPE html>
HTML metadata is data about the HTML document. Metadata is not displayed.
Metadata typically define the document title, character set, styles, scripts, and
other meta information.
The <meta> element is used to specify which character set is used, page
description, keywords, author, and other metadata.
Canvas SVG
With web storage, web applications can store data locally within the user's
browser.
Unlike cookies, the storage limit is far larger (at least 5MB) and information is
never transferred to the server.
Web storage is per origin (per domain and protocol). All pages, from one origin,
can store and access the same data.
HTML web storage provides two objects for storing data on the client:
Before using web storage, check browser support for localStorage and
sessionStorage:
// Store
localStorage.setItem("lastname", "Smith");
// Retrieve
document.getElementById("result").innerHTML =
localStorage.getItem("lastname");
localStorage.removeItem("lastname");
• Fragments in React?
A common pattern in React is for component to
return multiple elements. Fragments lets you group
list of children without adding extra nodes to the
DOM.
e.g
render(){
return(
<React.Fragment>
<ChildA />
<ChildB />
<ChildC />
</React.Fragment>
);
}