A SQL query has a table, a list of columns, any number of conditions, an order and a limit. A function that takes all of that positionally is unreadable: buildQuery('users', ['id'], 'age > 18', null, 10) leaves you counting commas to work out which argument is the limit.
Building the string by concatenation is worse than ugly. Gluing a value straight into the SQL text is exactly how SQL injection happens, and the caller has no way to tell which arguments are data and which are syntax.