+375445346560 A1 +375336340886 МТС TG: @fkmx1 Discord: @fkmx1
My goal is to become a professional frontend developer, building user-friendly, fast, and visually appealing web applications. My priorities are clean code, performance, and accessibility. I learn quickly, pay attention to details, and constantly strive to improve.
I love Fibonacci numbers in general, but I must admit I love some more than others.
I would like for you to write me a function that, when given a number n (n >= 1 ), returns the nth number in the Fibonacci Sequence.
For example:
nthFibo(4) == 2
Because 2 is the 4th number in the Fibonacci Sequence.
For reference, the first two numbers in the Fibonacci sequence are 0 and 1, and each subsequent number is the sum of the previous two.
function nthFibo(n) {
let a = 0;
let b = 1;
for (let i = 3; i <= n; i++) {
let c = a + b;
a = b;
b = c;
}
return n === 1 ? a:b ;
}
Website Markup (HTML5, CSS3, JavaScript)
I graduated from the Belarusian Russian University of Mogilev with a degree in software engineering from 2018 to 2022.
My English level is B1