JavaScript Arrays have lots of helpful built-in methods.
These methods allow you to write more declarative/functional code as opposed to imperative code.
| name: CICD | |
| # Triggers the workflow on push to master | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: |
| export async function getData() { | |
| async function userData(url = '', data = {}) { | |
| // Default options are marked with * | |
| const response = await fetch(url, { | |
| method: 'GET', // *GET, POST, PUT, DELETE, etc. | |
| mode: 'cors', // no-cors, *cors, same-origin | |
| cache: 'no-cache', // *default, no-cache, reload, force-cache, only-if-cached | |
| credentials: 'same-origin', // include, *same-origin, omit | |
| headers: { | |
| 'Content-Type': 'application/json', |
| const [nameInput, setName] = useState(name); | |
| const [emailInput, setEmail] = useState(email); | |
| const setter = set => e => { | |
| const { target } = e; | |
| const { value } = target; | |
| set(value); | |
| }; | |
| <Input value={nameInput} onChange={setter(setName)} required /> |
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Chrome", | |
| "type": "chrome", | |
| "request": "launch", | |
| "url": "http://localhost:3000", | |
| "webRoot": "${workspaceFolder}/src", | |
| "sourceMapPathOverrides": { |
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "chrome", | |
| "request": "launch", | |
| "name": "Next: Chrome", | |
| "url": "http://localhost:3000", | |
| "webRoot": "${workspaceFolder}" | |
| }, |
| { | |
| // Use IntelliSense to learn about possible attributes. | |
| // Hover to view descriptions of existing attributes. | |
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Python: Current File (Integrated Terminal)", | |
| "type": "python", | |
| "request": "launch", |
| { | |
| // Use IntelliSense to learn about possible attributes. | |
| // Hover to view descriptions of existing attributes. | |
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "type": "node", | |
| "request": "launch", | |
| "name": "Launch via NPM", |