Skip to content

Commit 5412a2a

Browse files
save file
1 parent 6fc7ac5 commit 5412a2a

File tree

1 file changed

+144
-68
lines changed

1 file changed

+144
-68
lines changed

blog/25-08-07/determine-datatypes-in-javascript/determine-datatypes-in-javascript.html

Lines changed: 144 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -3,69 +3,103 @@
33

44
<html>
55

6-
76
<head>
8-
7+
<meta charset=utf-8>
98

109
<title>
11-
determine datatypes in javascript
10+
Determine Datatypes In Javascript
1211
</title>
1312

14-
15-
<base href='https://ext-code.com/blog/25-08-07/determine-datatypes-in-javascript/'>
16-
<base href='https://javascript-2020.github.io/blog/25-08-07/determine-datatypes-in-javascript/'>
17-
18-
19-
<link rel=canonical href='https://ext-code.com/blog/25-08-07/determine-datatypes-in-javascript/determine-datatypes-in-javascript.html'>
20-
13+
<meta name=description content='Learn how to determine data types in JavaScript. Explore interactive, editable code examples that let you test and understand type detection in real time.'>
2114
<link rel=icon type='image/png' href='/blog/image/blog-30.png'>
22-
23-
<link rel=stylesheet href='/blog/css/blog.css'>
15+
<meta name=viewport content='width=device-width, initial-scale=1'>
2416

2517

26-
<script src='https://ajaxorg.github.io/ace-builds/src-noconflict/ace.js'></script>
18+
<base href='https://ext-code.com/blog/25-08-29/determine-datatypes-in-javascript/'>
19+
<link rel=canonical href='https://ext-code.com/blog/25-08-29/determine-datatypes-in-javascript/determine-datatypes-in-javascript.html'>
20+
2721

22+
<script type='application/ld+json'>
23+
{
24+
"@context" : "https://schema.org",
25+
"@type" : "TechArticle",
26+
"headline" : "Determine Datatypes In Javascript",
27+
"description" : "Learn how to determine data types in JavaScript. Explore interactive, editable code examples that let you test and understand type detection in real time.",
28+
"author" : {"@type":"Person","name":"Matthew Richards"},
29+
"datePublished" : "2025-07-31",
30+
"dateModified" : "2025-10-22",
31+
"mainEntityOfPage" : {"@type":"WebPage","@id":"https://ext-code.com/blog/25-08-29/determine-datatypes-in-javascript/determine-datatypes-in-javascript.html"},
32+
"publisher" : {"@type":"Organization","name":"Your Blog or Company Name","logo":{"@type":"ImageObject","url":"https://ext-code.com/favicon.ico"}},
33+
}
34+
</script>
35+
<!--
36+
"image" : "https://yourdomain.com/images/http2-nodejs-demo.png"
37+
-->
38+
39+
40+
<!--
41+
//:
42+
-->
2843

2944

45+
<script src='https://ajaxorg.github.io/ace-builds/src-noconflict/ace.js'></script>
3046

3147

3248
<script src='https://libs.ext-code.com/js/dom/component/component.js'></script>
3349

50+
3451
<script init>
3552
console.clear();
3653
console.log('determine-datatypes-in-javascript.html');
3754
console.log();
3855
console.json=v=>console.log(JSON.stringify(v,null,4));
39-
var df=true,did='page'
56+
var df=true,version='v2.0'
4057
;
4158

59+
60+
var ace;
61+
4262
var ext;
4363
var $;
4464
var datatype;
4565
var menumod;
46-
var code;
4766

67+
var menu;
4868

49-
//var codeblock;
69+
var ex1;
70+
var ex2;
71+
var ex3;
5072

73+
var log;
5174

75+
5276
//:
5377

5478

55-
mod.stack.add = init;
56-
5779
async function init(){
58-
//debug('init',version);
59-
//codeblock = mod['code-block']();
60-
61-
//codeblock.initmod({ext,$,code});
80+
debug('init',version);
81+
menu = menumod();
6282

6383

64-
//await codeblock.init();
84+
ex1 = mod.ex1;
85+
ex2 = mod.ex2;
86+
ex3 = mod.ex3;
87+
log = mod.log;
88+
89+
ex1.initmod({ext,$,menu,ace});
90+
ex2.initmod({ext,$,menu,ace});
91+
ex3.initmod({ext,$,menu,ace});
92+
log.initmod({ext,$});
93+
94+
await Promise.all([
95+
ex1.init(),
96+
ex2.init(),
97+
ex3.init(),
98+
log.init(),
99+
]);
65100

66-
menu = menumod();
67101

68-
await initdom(document.body);
102+
initdom(document.body);
69103

70104

71105
}//init
@@ -82,14 +116,10 @@
82116
'js/core/datatype.js',
83117
'js/dom/menumod/menumod.js',
84118
'js/dom/keydown/keydown.js',
85-
'js/dom/code/v2.0/code-v2.0.js.api',
119+
'js/debug/debug.js',
86120
);
87-
[$,datatype,menumod,keydown,code] = await promise;
121+
[$,datatype,menumod,keydown,debug] = await promise;
88122

89-
90-
code.initmod({ext,$,datatype,menumod});
91-
92-
93123
mod.stack.complete;
94124

95125
})();
@@ -101,11 +131,51 @@
101131
<style>
102132

103133
html
104-
{height:100%}
134+
{height:100%;font-family:arial}
105135
body
106-
{min-height:calc(100% - 40px);display:flex;flex-direction:column;gap:10px;
107-
font-family:arial
136+
{min-height:calc(100% - 40px);display:flex;flex-direction:column;gap:20px;margin:20px;align-items:center;
137+
padding-bottom:200px;
108138
}
139+
body>*
140+
{max-width:1400px;width:100%}
141+
142+
[component]
143+
{display:none}
144+
145+
.description
146+
{max-width:1000px;text-align:justify;border-left:4px solid #4a90e2;padding:1rem 2rem;
147+
background-color:#f9f9f9;font-family:system-ui,sans-serif;font-size:1rem;line-height:1.6;color:#333}
148+
.description>p
149+
{margin:0}
150+
.description > p+p
151+
{margin:10px 0}
152+
153+
code
154+
{font-family:monospace;background:whitesmoke}
155+
code.inline
156+
{display:inline;padding:5px 10px}
157+
158+
a
159+
{color:#4a90e2;text-decoration:none;font-weight:500}
160+
a:hover
161+
{text-decoration:underline}
162+
.link-domain
163+
{font-size:0.85rem;color:#777;margin-left:0.25rem}
164+
.link-domain::before
165+
{content:'['}
166+
.link-domain::after
167+
{content:']'}
168+
.link-txt
169+
{}
170+
171+
input
172+
{font-size:16px;padding:5px 7px;box-sizing:border-box;}
173+
input[type=button]
174+
{cursor:pointer}
175+
176+
177+
178+
109179

110180
h3
111181
{text-align:center;color:blue}
@@ -131,44 +201,55 @@
131201

132202

133203
<body>
134-
135-
<h3>
136-
determine datatypes in javascript
137-
</h3>
138204

139205

140-
<div id=desc>
206+
<blog-hdr component=grp1 v2.0>
207+
<h1 class=title>
208+
Determine Datatypes In Javascript
209+
</h1>
210+
<time slot=date datetime=2025-10-29>
211+
29 Oct 2025
212+
</time>
213+
</blog-hdr>
141214

142-
Determining datatypes in javascript always seemed to be a bit of a mystery, I've seen hundreds
143-
of incarnations over the years, some work in some circumstances, until the code starts to get more
144-
complex and then just mysteriously stop working, my go to for datatype has always been the following :
145-
215+
<div class=description>
216+
<p>
217+
Learn how to determine data types in JavaScript. Explore interactive, editable code examples that let you test and understand type detection in real time.
218+
</p>
146219
</div>
147220

148-
<code-block snippet-console src=ex1></code-block>
221+
<div class=description>
222+
Determining datatypes in javascript always seemed to be a bit of a mystery, I've seen hundreds
223+
of incarnations over the years, some work in some circumstances, until the code starts to get more
224+
complex and then just mysteriously stop working, my go to for datatype has always been the following :
225+
</div>
149226

227+
<snippet-console id=ex1 component v2.0 src='ex/ex1.js'></snippet-console>
150228

151-
<div class=break></div>
152229

230+
<div class=break></div>
231+
232+
153233
<div>
154-
155-
This can be extended further through the use of
156-
234+
This can be extended further through the use of
157235
</div>
158236

159-
<code snippet-console src=ex2></code>
237+
<snippet-console id=ex2 component v2.0 src='ex/ex2.js'></snippet-console>
160238

161239

162240
<div class=break></div>
163241

164-
<div>
165-
166-
There have been many a bug created by using
167242

243+
<div>
244+
There have been many a bug created by using
168245
</div>
169246

170-
<code snippet-console src=ex3></code>
247+
<snippet-console id=ex3 component v2.0 src='ex/ex3.js'></snippet-console>
171248

249+
250+
<log component v2.0></log>
251+
252+
172253
</body>
173254

174255

@@ -178,35 +259,30 @@ <h3>
178259
<script>
179260

180261

181-
var menu;
182-
183-
var snippets = [];
184-
185262

186263
//:
187264

188265

189-
async function initdom(rootnode){
266+
function initdom(rootnode){
190267

191268

192269
root = rootnode;
193270

194271

195-
196-
var node = $(root,'code-block');
197-
code.code_block(mod,node,{menu,ace});
198-
199-
200-
201-
202-
await code.snippet_console.all(mod,root,{menu,ace});
203-
272+
ex1.initdom();
273+
ex2.initdom();
274+
ex3.initdom();
275+
276+
277+
log.initdom();
204278

205279

206-
207280
}//initdom
208281

209282

283+
//:
284+
285+
210286

211287

212288

0 commit comments

Comments
 (0)