console.log("Hello, World!");
const str = "Hello";
const str = 'They call him "Harry", and he likes it';
///They call him "Harry", and he likes it
const str = "They call him 'Harry', and he likes it";
/// They call him 'Harry', and he likes it
const str = "They call him "Harry", and he likes it";
const str = "They call him \"Harry\", and he likes it";
const str2 = 'They call her \'Ann\', and she likes it';
// They call him "Harry", and he likes it
// They call her 'Ann', and she likes it
const result = greet("Sherlock"); // "Well hello, Sherlock"
const greet = (str) => {
return "Well hello, " + str;
}
const skip = (str) => {
let i = 0;
let result = '';
while (i < str.length) {
result = result + str[i];
i = i + 2;
}
return result;
}
const skipped = skip('cats');
while (counter <= n) {
result = result * result;
counter = counter + 1;
}
const str = 'hello';
// toUpperCase возвращает ту же строку в верхнем регистре
str.toUpperCase(); // HELLO
console.log(str); // => hello
str[0].toUpperCase(); // H
console.log(str); // => hello
str[0] = 'W';
console.log(str); // => hello
'a' < 'b' // true
'a' > 'b' // false
'abc' > 'abc' // false
'abb' > 'abc' // false
'abd' > 'abc' // true
``
const name = "Alex";
const a = 10;
const b = 12;
console.log(`His name was ${name} and his age was ${a + b}`);
const str1 = "Hello";
const str2 = 'Hello';
const str1 = 'They call him "Harry", and he likes it';
const str2 = "They call him 'Harry', and he likes it";
const str1 = 'They call her \'Ann\', and she likes it';
const str2 = "They call her \"Ann\", and she likes it";
const str = "There is a tab \t and here \ncomes the new line!"
// Here is a tab and here
// comes the new line!
const str = "This is a backslash \\ here"
// This is a backslash \ here
const name = "Alex";
const age = 22;
console.log("His name is " + name + " and his age is " + age);
// His name is Alex and his age is 22
const skip = (str) => {
let i = 0;
let result = '';
while (i < str.length) {
result = result + str[i];
i = i + 2;
}
return result;
}
Пройти тест |
Дальше |
Проверить |
Завершить тест |
Дальше |
Проверить |
Завершить тест |
Дальше |
Проверить |
Завершить тест |
Дальше |
Проверить |
Завершить тест |
Дальше |
Проверить |
Завершить тест |
Дальше |
Проверить |
Завершить тест |
Дальше |
Проверить |
Завершить тест |
Дальше |
Проверить |
Завершить тест |
Пройти еще раз |
Пройти еще раз |
Пройти еще раз |
Пройти еще раз |
reverse('hello, world!'); // !dlrow ,olleh