Coder Social home page Coder Social logo

homework_lemon's People

Contributors

olegyerokhin avatar

Watchers

 avatar  avatar

homework_lemon's Issues

2021-05-21

case 7: alert('Подходит! Вы едете домой!'); break;

break здесь можно опустить, только после третьего case оставить. И не дублировать сообщение.
аналогично здесь
case 'saturday': alert('Выходные!'); break;

.
case 'USD-UAH': usdUah = +prompt('Какую сумму долларов Вы хотите продать?',''); result = (usdUah * 27.46); answer = `Вы получите ${result} гривень!`; break;

такие длинные строки лучше разбивать для лучшей читаемости

switch (operationType) {
    case 'USD-UAH':
        usdUah = +prompt('Какую сумму долларов Вы хотите продать?','');
        result = (usdUah * 27.46);
        answer = `Вы получите ${result} гривень!`;
        break;
    case 'UAH-USD':
        uahUsd = +prompt('Какую сумму гривень Вы хотите продать?','');
        result = (uahUsd / 27.46);
        answer = `Вы получите ${result} долларов!`;
        break;
    default:
        alert('Введите корректные данные!');
        answer = 'Невозможно рассчитать!';
        break;
}

и, кстати, магическое число 27.46 тоже лучше сохранить в переменную, чтобы было понятно, что это такое
.

case 0: alert('Sunday!'); break;

в операторе switch, как правило, проверяют и определяют значение в переменную. Показать в alert потом можно это значение. И еще дальше его можно будет использовать при необходимости.

2021-06-04

message = prompt('Enter your message!','');

ну, prompt имеет два параметра, и первый не равен "Enter your message!" :) Не совсем полноценный аналог prompt получился. Вот с a все в порядке

2021-06-09


в функции bar переменная i так и осталась "неявно глобальной", ей бы тоже let дать
.
const array = ['💫', '💥', '🌍', '🛸', '🦕', '🦖', '🐉', '🐊', '🐊', '🌠', '🐊', '🐊', '🌠', '🐊', '🐊', '🌠', '🐍', '🐊', '🐊', '🐘', '🦌', '🐇', '🦔', '🦨', '🦅', '🐝', '🐵', '🌄', '🧑', '👫', '👨‍👩‍👦', '👨‍👩‍👧‍👦', '📈', '🏙', '🚄', '🛫', '🚁', '⛽', '🛰', '🧬', '🧟‍♂️', '🧟‍♀️', '📉', '🔫', '🌊', '☀', '🌡', '🔥', '💀', '📡', '👽', '🚀', '🌌', '🪐', 'MEANWILE...', '🌍', '🐊'];

шикарная история )

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.