Materi
Roadmap
Proyek
Sertifikat
Skillance Code Lab
Jalankan »
Skillance Code Lab Editor
Editor
Hasil
Split
Editor Kode Sumber
Tekan
Ctrl + Enter
untuk Menjalankan
<!DOCTYPE html> <html> <body style="font-family: sans-serif; padding: 20px;"> <h2>Pemeriksaan Tipe Data (typeof)</h2> <pre id="hasilTypeof" style="background:#1e293b; color:#38bdf8; padding:15px; border-radius:8px;"></pre> <script> const teks = typeof "Halo"; const angka = typeof 12345; const boolean = typeof true; const objek = typeof { id: 1 }; const takTerdefinisi = typeof belumDiisi; document.getElementById('hasilTypeof').innerText = 'typeof "Halo" -> ' + teks + ' ' + 'typeof 12345 -> ' + angka + ' ' + 'typeof true -> ' + boolean + ' ' + 'typeof { id: 1 } -> ' + objek + ' ' + 'typeof takTerdefinisi -> ' + takTerdefinisi; </script> </body> </html>
Hasil Tampilan (Browser Preview)
Muat Ulang