2 added 359 characters in body

# JavaScript (Babel Node), 41 bytes

f=(n,i=1,j=1)=>j<n?f(n,j,j+i):j-n>n-i?i:j


Based on ovs's awesome Python answer

Try it online!

### Ungolfed

f=(n,i=1,j=1)=> // Function f: n is the input, i and j are the most recent two Fibonacci numbers, initially 1, 1
j<n?           // If j is still less than n
f(n,j,j+i)    //  Try again with the next two Fibonacci numbers
:              // Else:
j-n>n-i?i:j   //  If n is closer to i, return i, else return j


# JavaScript (Babel Node), 41 bytes

f=(n,i=1,j=1)=>j<n?f(n,j,j+i):j-n>n-i?i:j


Based on ovs's awesome Python answer

Try it online!

# JavaScript (Babel Node), 41 bytes

f=(n,i=1,j=1)=>j<n?f(n,j,j+i):j-n>n-i?i:j


Based on ovs's awesome Python answer

Try it online!

### Ungolfed

f=(n,i=1,j=1)=> // Function f: n is the input, i and j are the most recent two Fibonacci numbers, initially 1, 1
j<n?           // If j is still less than n
f(n,j,j+i)    //  Try again with the next two Fibonacci numbers
:              // Else:
j-n>n-i?i:j   //  If n is closer to i, return i, else return j

1

# JavaScript (Babel Node), 41 bytes

f=(n,i=1,j=1)=>j<n?f(n,j,j+i):j-n>n-i?i:j


Based on ovs's awesome Python answer

Try it online!