Can you please explain this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Can you please explain this code?

Cz, these type of syntax isn't in tutorials. Specially line number 4 in is tab. https://code.sololearn.com/Whzgl4I41okE/?ref=app

25th Feb 2020, 9:47 PM
Avinash
Avinash - avatar
2 Answers
+ 2
👑🌟Avinash🌟👑 hello, To add at Hrvoje answer , Line 4,9&13 are arrow functions which are assigned to constants,and then you call that constant as a function: calcFps(); For better understanding you could check "arrow functions " ( and maybe also "anonymous functions".)
26th Feb 2020, 1:07 AM
EmmanueLZ.
EmmanueLZ. - avatar
+ 1
1: indicates strict mode 3: defines variables 4: defines constant and creates lambda 5: defines variable and assignes the value (time difference from last execution of line 6) 6: assignes the value to the variable (actual time) 7: prints out string and product of the formula 9: defines constant and creates lambda 10: calls lambda (as the value of a constant) 11: calls animation mode in browser 13: defines constant and creates lambda 14: calls constant value (lambda) 16: starts lambda (cinstant value) on the page load
25th Feb 2020, 10:56 PM
Hrvoje
Hrvoje - avatar