Sites that use React:
testxax |
Here's the list of things that compile or transpile to JavaScript. The list only includes those who have website compiler. It is ordered alphabetically and linked to the playground:
Here's the list of my React sandboxes.
The purpose is to have a reproducible exploration into the React ecosystem.
It is linked to the repo and sandbox:
- React 17 without automatic batching. [repo][sandbox]
- React 18 with automatic batching. [repo][sandbox]
- Page scrolling into an element by id. [repo][sandbox]
- Internationalization (I18N) with aws-amplify. [repo][sandbox]
- Styling MUI DatePicker. [repo][[sandbox](https://codesandbox.io/s/github/artidata/styling-m
{https://web.facebook.com/photo/?fbid=1106883760205734&set=gm.5560213294029429} | |
program program_segitiga; | |
uses crt; | |
type | |
segitiga = Record | |
alas : Integer; | |
tinggi : Integer; | |
end; |
Mungkin saya luruskan dulu pengertian CORS nya.
Sebenernya "CORS error" di browser terjadi karena browser Fetch API tunduk sama same-origin policy
.
Jadi defaultnya, JavaScript yang di serve di situs https://domain-a.com tidak dibolehkan browser melakukan http request ke https://domain-b.com/data.json.
Justru CORS (Cross-Origin-Resource-Sharing) itu mekanisme yang membolehkan kode JavaScript yang di browser yang di serve di https://domain-a.com untuk melakukan http request ke domain lain contohnya https://domain-b.com/data.json.
Implementasinya seperti apa?
Melalui http header Access-Control-Allow-Origin
dari server.
Kalau misalnya http header itu valuenya *, berarti CORS enabled, jadi javascript dari website apapun dibolehkan browser mengakses resources dari server tersebut.
function computeClosestToZero(arr: number[]) { | |
return arr.length > 0 | |
? arr.sort((a, b) => { | |
let absDiff = Math.abs(a) - Math.abs(b); | |
return absDiff === 0 ? b - a : absDiff; | |
})[0] | |
: 0; | |
} |