Това е отличен размер за практикуване на типове променливи, функции и т.н. в Javascript. Получавам грешка при управлението на кода и не знам причината, след като прекарах над 2 часа в търсене на отговора.
Може ли да погледнете pls:
Може ли да погледнете pls:
Код:
const number = 14;
const string = "yes";
const booleanVar = (10 > 9);
const nullVar = 0;
const undefinedVar = f = 2; var h = undefined
const pi = 3.1415926;
const piPlusOne = pi + 1;
const piMinusOne = pi - 1;
const piDividedByThree = pi / 3;
const piSquared = math.pow(3.1415926,2);
const piRoundedUp = math.floor(pi);
const piRoundedUp = math.ceil(pi);
Math.random(1);
if (true)
{console.log ("Marco")
if (false)
console.log ("Polo")
}
}
} else { console.log ("Marco Polo")
}
// Remove _replaceMe_ and assign the variables below using x and y.
const x = 7.5;
const y = -15;
const isXLessThanY =x<y;
const xMinusY = x-y;
const yDividedByX = ;
const xAsAString = "x";
const YToThePowerOfX = math.pov(x,y);
const yRoundedUp = math.round(y);
//move the console log at the start of the code to greet Evelyn. Do not
modify anything else.
let mysteryVar = 'start value';
console.log(mysteryVar);
const name = 'Evelyn';
console.log ('Good morrow');
const greeting2 = 'Farewell';
if (name.length < Math.random()*10) {
mysteryVar = greeting1 + ', ' + name;
} else {
mysteryVar = greeting2 + ', ' + name;
}
mysteryVar = null;
// Stretch Task:
// Research the following string methods: includes, indexOf, slice,
toUpperCase, toLowerCase
// Using those methods on 'sampleText', correctly remove _replaceMe_ and
assign the following variables.
const sampleText = "Isn't documentation great!";
const trueValue = sampleText.includes('great!');
const falseValue = index.(falseValue);
const fruit ["apple", "cherry", "orange"];
console.log(fruit.slice(0, 1));