Véletlen számok
This commit is contained in:
1 parent
636b5acb6a
commit
b4e3fc5eb6
2 files changed
+42
No files matched your search
@@ -0,0 +1,18 @@
|
|||||||
|
let egyik=34;
|
||||||
|
let masik=egyik;
|
||||||
|
|
||||||
|
console.log(masik);
|
||||||
|
masik=56;
|
||||||
|
|
||||||
|
console.log(egyik);
|
||||||
|
console.log(masik);
|
||||||
|
|
||||||
|
|
||||||
|
let masikSzamok=[1,2,3,4,5];
|
||||||
|
let harmadikSzamok=masikSzamok;
|
||||||
|
|
||||||
|
harmadikSzamok[0]=111;
|
||||||
|
|
||||||
|
//??
|
||||||
|
console.log(masikSzamok);
|
||||||
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
|
||||||
|
let veletlen=Math.random();
|
||||||
|
|
||||||
|
console.log(veletlen);
|
||||||
|
|
||||||
|
//Egész szám megadott határok között
|
||||||
|
|
||||||
|
veletlen=Math.random()*10;
|
||||||
|
|
||||||
|
console.log(veletlen);
|
||||||
|
|
||||||
|
veletlen=Math.floor(Math.random()*10)+1;
|
||||||
|
|
||||||
|
console.log(veletlen);
|
||||||
|
|
||||||
|
veletlen=Math.floor(Math.random()*(100-10))+10;
|
||||||
|
|
||||||
|
console.log(veletlen);
|
||||||
|
|
||||||
|
function veletlenSzam(min,max){
|
||||||
|
return Math.floor(Math.random()*(max-min))+min;
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(veletlenSzam(5,25));
|
||||||
Reference in new issue
Block a user