miniapp v JS, problem
Napísané: So 15. Dec, 2018, 14:36
Caute, zacinam sa ucit programovat (UDEMY) mam druhy kurz, uz v tom prvom mi appka nesla a teraz mi nefunguje toto:
var randomBodyParts = ['face','hair','foot','tool'];
var randomAdjectives = ['smelly','stupid','boring','lazy'];
var randomWords = ['rat','dog','fly','stick'];
var randomBodyPart = randomBodyParts[Math.floor(Math.random * 4)];
var randomAdjective = randomAdjectives[Math.floor(Math.random *4 )];
var randomWord = randomWords[Math.floor(Math.random * 4)];
document.write('Your ' + randomBodyPart + ' is like a ' + randomAdjective + ' ' + randomWord + '!!!');
Diky za fix.
PS: mam MAMB Apache, cize pisem do localhost index.php.
PS2: Povodne som to robil cez Chrome konzolu ani tam to nejde.
PS3: Dostal som sa tu: Your undefined is like a undefined undefined.
THX.
var randomBodyParts = ['face','hair','foot','tool'];
var randomAdjectives = ['smelly','stupid','boring','lazy'];
var randomWords = ['rat','dog','fly','stick'];
var randomBodyPart = randomBodyParts[Math.floor(Math.random * 4)];
var randomAdjective = randomAdjectives[Math.floor(Math.random *4 )];
var randomWord = randomWords[Math.floor(Math.random * 4)];
document.write('Your ' + randomBodyPart + ' is like a ' + randomAdjective + ' ' + randomWord + '!!!');
Diky za fix.
PS: mam MAMB Apache, cize pisem do localhost index.php.
PS2: Povodne som to robil cez Chrome konzolu ani tam to nejde.
PS3: Dostal som sa tu: Your undefined is like a undefined undefined.
THX.