Показать сообщение отдельно
  #1 (permalink)  
Старый 15.08.2016, 20:04
Новичок на форуме
Отправить личное сообщение для malin Посмотреть профиль Найти все сообщения от malin
 
Регистрация: 12.02.2016
Сообщений: 5

Помогите сделать задание
Задание такое

5. JavaScript

Description:

Write a functions that will make basic math calculations to produce results like in the following example. Please, do not use "eval":

three(times(five())); // must return 15
four(plus(eight())); // must return 12
eight(minus(two())); // must return 6
six(dividedBy(three())); // must return 2

Your Solution (you can change the template whatever you want):

function zero(x) {}
function one(x) {}
function two(x) {}
function three(x) {}
function four(x) {}
function five(x) {}
function six(x) {}
function seven(x) {}
function eight(x) {}
function nine(x) {}

function plus(x) {}
function minus(x) {}
function times(x) {}
function dividedBy(x) {}

function checkCalculations() {
console.log(three(times(five())));
console.log(four(plus(eight())));
console.log(eight(minus(two())));
console.log(six(dividedBy(three())));
}
Ответить с цитированием