printing


Node.js

  1. console.log('hello world')
  2. console.log('hello %s', 'world')
  3. console.log('hello %d %s', 5, 'worlds')

Output

  1. hello world
  2. hello world
  3. hello 5 worlds

Go

  1. package main
  2. import "fmt"
  3. func main() {
  4. fmt.Println("hello world")
  5. fmt.Printf("hello %s\n", "world")
  6. fmt.Printf("hello %d %s\n", 5, "worlds")
  7. }

Output

  1. hello world
  2. hello world
  3. hello 5 worlds