Testiranje

by Daman Daman

JavaScript

function test(iskaz, opis ) { 
    var rezultat = iskaz ? 'tacno' : 'netacno'; 
    if (opis) console.log (opis)
    console.log (rezultat)
}; 

test (2 + 2 == 3, "Oceni iskaz")
test (2 + 2 == 4)
test (typeof 4 === "number")
test (typeof null === typeof undefined)