- 4
How to name it
Solved i made function which make array from pseudo-array. For example: var obj={0: "a", 1: "b", length: 2, text: "hello"}, then f(obj)==["a","b"] this can be used in cycle: for(var i=0; i<obj.length; i++) = for(var i in f(obj)) Make short name for this function f() please
24 ответов
+ 1
typeSort()
+ 1
"f"
+ 1
"function_that_does_things"
+ 1
You wrote the function, you know what it does, you know what to associate with it. Give it any name you feel comfortable with. If you want to name it "f" then do that.
Don't over-think it, you can still change it later if necessary.
+ 1
Okay i go play brawl stars
+ 1
You're thinking too much about it, it's just a function. :)
You don't need to write a full sentence, just the most essential part: numObj2arr, numeric object parts to array.
You can still re-name it later.
+ 1
HungryTradie thanks for explanations
+ 1
K.S. Nandhu i understand
0
Simon Sauter genius
0
I need normal name :/
0
"f" is a perfectly normal name for a function.
0
normal name must be associated with things which function does. "f" associated with nothing
0
Simon Sauter it is only worse because longer
0
Well if longer is worse, then what better name than "f"? "i"?
0
I know what it does, i can name it "make_array_of_object_properties_which_have_numeric_name" but it is to long
0
"maoopwhnn"
0
I understand, gonna try to use something likt that
0
Ti loh i bot yobaniy, idi nahui
0
HungryTradie ok, normal
0
We should not use any special character except underscore for identifiers
Syntax of for loop is
for<variable>in<sequence>:
We can add range() except sequence
But in this syntax error