Upgrade Skill Di ITBOX Jadi Lebih Hemat
Special Diskon 50%
Sampai 16 November 2026!
Hari
Jam
Menit
Detik
GARUDABOX

Variabel

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #47374
    Tufel Shobrun
    Participant

      Kak saya mau tanya tadi saya abis mengerjakan latihan
      Variabel sbagai berikut

      Var p=1;
      Var q=’1′;
      Var r= p==q;
      Console.log(r);

      Setelah saya running di visual studio code
      Kenapa hasil nya “True” ya kak ?
      Bukankah itu adalah 2 variabel yg berbeda kan ?
      Yg P variabel Angka
      Yg q variabek string

      Mohon jawaban nya

      #47815
      Coach Vincent
      Moderator

        karenan untuk equal “==” hanya mengecek valuenya saja.
        untuk cek value dan tipe data, bisa menggunakan “===”

      Viewing 2 posts - 1 through 2 (of 2 total)
      • You must be logged in to reply to this topic.
      Shopping cart0
      There are no products in the cart!
      Continue shopping