Python and JavaScript quine

A program producing its complete source code as its only output.

Python

A Python quine using repr for escaping.

a = 'a = %r\nprint(a %% a)'
print(a % a)

JavaScript

Same thing in JavaScript via JSON formatting.

const a = "const a = %s\nconsole.log(a, JSON.stringify(a))"
console.log(a, JSON.stringify(a))