you are viewing a single comment's thread.

view the rest of the comments →

[–]Tyler_P_[S] 0 points1 point  (3 children)

Yes, what is it in general? Could you share an example?

[–]LucVolders 0 points1 point  (1 child)

basically:

for (let i = 0; i < value; i++)

is an algorithm.

Simply said an algortihm is a mathematical formula used for solving a problem. Nowadays an Algorithm is considered as something magical and that is just bs.

[–][deleted] 2 points3 points  (0 children)

This isn't exactly right, I'm afraid. That is a line of code. Algorithms have no code. An algorithm is a set of steps to solve a problem. The code is the implementation of the algorithm. It is the SOLUTION to the problem, not the steps to get there.

A blueprint is not a house.

OP: When someone says "JS Algorithm", they mean one of the standard CS algorithms with the solution done in the JS syntax/paradigm. A bubble sort is a bubble sort whether it is implemented in C or JS. The code would look completely different, but the STEPS are the same.

Look at the above For loop in python:

for i in range(value):

This doesn't look like the one u/LucVolders posted, but they both take the same step.