Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 080be73

Browse filesBrowse files
committed
refactor the Scripts Loading snippet
1 parent 0d79fcd commit 080be73
Copy full SHA for 080be73

File tree

1 file changed

+1
-3
lines changed
Filter options

1 file changed

+1
-3
lines changed

‎pages/Loading/Script-Loading.mdx

Copy file name to clipboardExpand all lines: pages/Loading/Script-Loading.mdx
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@ List all the `<scripts>` in the DOM and show a table to see if are loaded `async
88
const scripts = document.querySelectorAll("script[src]");
99

1010
const scriptsLoading = [...scripts].map((obj) => {
11-
let newObj = {};
12-
newObj = {
11+
return {
1312
src: obj.src,
1413
async: obj.async,
1514
defer: obj.defer,
1615
module: obj.type === 'module',
1716
"render blocking": obj.async || obj.defer || obj.type === 'module' ? "" : "🟥",
1817
};
19-
return newObj;
2018
});
2119

2220
console.table(scriptsLoading);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.