html
html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<p id="1" data-cont="1">Temporary 1</p>
<p id="2" data-cont="2">Temporary 2</p>
<script src='index.js' ></script>
</body>
</html>
Enter to Rename, Shift+Enter to Preview
css
css
1
2
3
body {
}
Enter to Rename, Shift+Enter to Preview
js
js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
showText = (domElementSelector, text) =>{
const idnode = document.querySelector(domElementSelector )
if(idnode) {
idnode.innerHTML = text
}
}
const load=function(){
const numbers = Array(11).fill(0).map((v,i)=>i);//sz11,fill with
const powers = {
get(target,name,receiver) {
return 2 ** Reflect.get(target,name,receiver);
}
}
const p = new Proxy(numbers, powers)
str1 = Object.values(p).toString()
str2 = `${p[0]}, ${p[5]}, ${p[10]}`
showText ('[data-cont="1"]', str1)
showText ('[data-cont="2"]', str2)
}
Enter to Rename, Shift+Enter to Preview
BROWSER
Console
Run