You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly great work! I was trying to understand your code, and if I've understood correctly your function F might not be working as you intended, though perhaps it doesn't matter 🤷
and specifically where you assign temp, you are doing an odd mix of numerical and string ops - basically the + operations are all doing string concatenation, as you operate on K and not k (perhaps you meant to use k? At the moment it's not used at all).
I would recommend changing to the following which I tested locally and also works:
Here as you can see I operate on k (lowercase), and the assignment to temp returns a number, not a string. That is then coerced to a string on the following line before being sliced and returned.
The text was updated successfully, but these errors were encountered:
Firstly great work! I was trying to understand your code, and if I've understood correctly your function
F
might not be working as you intended, though perhaps it doesn't matter 🤷Your code is :
(https://github.com/pballett/whatfreewords/blob/master/index.html#L40-L45)
and specifically where you assign
temp
, you are doing an odd mix of numerical and string ops - basically the+
operations are all doing string concatenation, as you operate onK
and notk
(perhaps you meant to usek
? At the moment it's not used at all).I would recommend changing to the following which I tested locally and also works:
Here as you can see I operate on
k
(lowercase), and the assignment totemp
returns a number, not a string. That is then coerced to a string on the following line before being sliced and returned.The text was updated successfully, but these errors were encountered: