Skip to content
Snippets Groups Projects
Commit 2eedadd6 authored by Andrej Rasevic's avatar Andrej Rasevic
Browse files

adding further react examples

parent 47f8078d
No related branches found
No related tags found
No related merge requests found
// jest-dom adds custom jest matchers for asserting on DOM nodes.
// allows you to do things like:
// expect(element).toHaveTextContent(/react/i)
// learn more: https://github.com/testing-library/jest-dom
import '@testing-library/jest-dom/extend-expect';
<!DOCTYPE html>
<html>
<head>
<title>Event Loop</title>
<script src="js/events.js"></script>
</head>
<body>
<div>
Open up the dev console to see how the event loop works with the job queue and task/callback queue
</div>
</body>
</html>
\ No newline at end of file
console.log('Message no. 1: Sync');
setTimeout(function() {
console.log('Message no. 2: setTimeout');
}, 0);
var promise = new Promise(function(resolve, reject) {
resolve();
});
promise.then(function(resolve) {
console.log('Message no. 3: 1st Promise');
})
.then(function(resolve) {
console.log('Message no. 4: 2nd Promise');
});
console.log('Message no. 5: Sync');
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment