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

error Uncaught SyntaxError: Unexpected token ‘>=’

Beranda › Forums › Belajar Menjadi Full Stack Web Developer Tingkat Pemula › error Uncaught SyntaxError: Unexpected token ‘>=’

Tagged: 

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #170870
    Agung Magrizal
    Participant

      hallo coach mohon pencerahannya coach

      sudah ikuti sesuai codingnya coach cm dijalanin error Uncaught SyntaxError: Unexpected token ‘>=’

      for(var i = 0; i < murid.length; i++){
      if(murid[i][2]) >= 3.0){
      console.log(murid[i][0] + “. ” + murid[i][1] +
      “, IPK = ” + murid[i][2] + “, Lulus”);
      } else {
      console.log(murid[i][0] + “. ” + murid[i][1] +
      “, IPK = ” + murid[i][2] + “, Gagal”);
      }
      }

      #170875
      Agung Magrizal
      Participant

        Sudah Nemu kendalanya karena ada tanda ) sebelum >= 3.0 :

        harusnya saya buat seperti ini

        var murid = [
        [1, “Vincent”, 3.5],
        [2, “Udin”, 3.0],
        [3, “Mamang”, 2.1]
        ]

        for(var i = 0; i < murid.length; i++){
        if(murid[i][2] >= 3.0){
        console.log(murid[i][0] + “. ” + murid[i][1] +
        “, IPK = ” + murid[i][2] + “, Lulus”);
        } else {
        console.log(murid[i][0] + “. ” + murid[i][1] +
        “, IPK = ” + murid[i][2] + “, Gagal”);
        }
        }

        #186630
        Coach Vincent
        Moderator

          terima kasih kak

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