What is function and why do we use it?
- Local and Global variables in JavaScript.
A small thread🧵👇
- A JavaScript function is a block of code designed to perform a particular task. It allows us to write more maintainable code. Define the code once, and use it many times. You don’t need to write the same code over and over again.
- It is defined with the function keyword, followed by a name and parentheses (). The code to be executed by the function is placed inside curly brackets: {}
- A JavaScript function is executed when "something" invokes it (calls it).
1- Figure: The <figure> tag specifies self-contained content, like illustrations, diagrams, photos, etc.
- The <figcaption> element is used to add a caption for the <figure> element.
2- Details: The <details> tag is often used to create an interactive widget that the user can open and close. By default, the widget is closed. When open, it expands and displays the content within.
- The <summary> tag defines a visible heading for the <details> element.
- Send Mail: While using <a> tag as an email tag, you will use mailto: email address along with href attribute.
- Dropdown Input: The <select> element is used to create a drop-down list. It is most often used in a form, to collect user input.
- The <option> tags inside the <select> element define the available options in the drop-down list.