How do I make sure to print something on the same line?

I need to make a pattern program like this using for loop

However, both console.log() and print() shift the cursor to a new line.
Is there any method to print on screen without sending the cursor away?


You can include multiple variables in one console.log statement :

console.log(“Firstname” + firstName + " "+ “Lastname” + lastName)


console.log(“First name %s Last name %s”, firstName, lastName)

Let name = “Fuzzy Wuzzy”
console.out(’ ${name} had no hair. ')

1 Like