Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Study</title>
- </head>
- <body>
- <script>
- 'use strict'
- class PrintMaсhine {
- constructor(size, color, family) {
- this.size = size
- this.color = color
- this.family = family
- }
- print(msg) { document.write(`<p style="font-size: ${this.size}; color: ${this.color}; font-family: ${this.family}">${msg}</p>`); }
- }
- let text = new PrintMaсhine('16px', 'red', 'cursive');
- text.print('Nice snowy .. spring :()!');
- let text1 = new PrintMaсhine('26px', 'blue', 'sans');
- text1.print('OOP in JS is Evil technology :)');
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement