07. Area of Figures- Проблем с input.shift
Здравейте, колеги!
Все пък, когато решавам задача и във Visual studio code ми тръгва всичко както трябва, но когато я събмитна в judge, абсолютно всеки път ми дава 0 точки и ми изписва следния error:
let type = (input.shift()); ^ TypeError: input.shift is not a function
Това ми е кодът:
function solve(input) {
let type = (input.shift());
let result = 0;
if (type === "square") {
let a = Number(input.shift());
result = a * a;
} else if (type === "rectangle") {
let a = Number(input.shift());
let b = Number(input.shift());
result = a*b;
} else if (type === "circle") {
let r = Number(input.shift());
result = Math.PI * r*r;
} else {
let a = Number(input.shift());
let h = Number(input.shift());
result = (a * h) / 2;
}
console.log(result.toFixed(3));
}
solve([
"triangle",
"4.5",
"20"
])
We have top essay writing services you can get all kinds of online dissertation writing services UK under one roof. Whether it is thesis writing services, homework help, assignment writing service UK or proofreading help, we cover all. Apart from that, each topic is handled by a specialized expert in that particular disciple. Give us a chance and experience a journey of coursework writing service UK excellence like never before.