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

Latihan study case max min

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #193049
    jihadhamasd
    Participant

      saya sudah mengikuti codingan yang sesuai di video tapi outpunya max:10 dan min: 10 juga

      function NilaiMiniMax(arrayAngka){
      var max= arrayAngka[0];
      min= arrayAngka[0];

      for(var i= 0; i<arrayAngka.Length; i++){
      if(max<arrayAngka[i]){
      max=arrayAngka[i];
      }
      if(min >arrayAngka[i]){
      min=arrayAngka[i];
      }
      }
      return {
      max: max,
      min: min
      }
      }

      console.log(NilaiMiniMax([10,3,5,12,7]));

      #194860
      Coach Vincent
      Moderator

        Utk penulisan arrayAngka.Length masih salah
        Seharusnya arrayAngka.length
        Terima kasih

      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