Skip to content

Instantly share code, notes, and snippets.

@evgeniyworkbel
Created November 11, 2021 08:27
Show Gist options
  • Save evgeniyworkbel/1c208f38310e4cbd93715b3f7bc28b85 to your computer and use it in GitHub Desktop.
Save evgeniyworkbel/1c208f38310e4cbd93715b3f7bc28b85 to your computer and use it in GitHub Desktop.
Подготов. курс JS (code-basics.ru)
// 1-ое решение
import { calculateDistanceBetweenTowns } from 'hexlet-basics/got';
const from = 'The Twins';
const to = 'The Eyrie';
// BEGIN (write your solution here)
const route = `${from}-${to}`;
console.log(calculateDistanceBetweenTowns(route));
// END
//2-ое решение
import { calculateDistanceBetweenTowns } from 'hexlet-basics/got';
const from = 'The Twins';
const to = 'The Eyrie';
// BEGIN (write your solution here)
console.log(calculateDistanceBetweenTowns(`${from}-${to}`));
// END
import { calculateDistanceBetweenTowns } from 'hexlet-basics/got';
const from = 'The Twins';
const to = 'The Eyrie';
// BEGIN
const distance = calculateDistanceBetweenTowns(`${from}-${to}`);
console.log(distance);
// END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment