ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 17 - Certified JavaScript Developer I discussion

Report
Export

A developer creates a class that represents a blog post based on the requirement that a Post should have a body author and view count.

The Code shown Below:

Class Post {

// Insert code here

This.body =body

This.author = author; this.viewCount = viewCount;

}} Which statement should be inserted in the placeholder on line 02 to allow for a variable to be set to a new instanceof a Post with the three attributes correctly populated?

A.
super (body, author, viewCount) {
Answers
A.
super (body, author, viewCount) {
B.
Function Post (body, author, viewCount) {
Answers
B.
Function Post (body, author, viewCount) {
C.
constructor (body, author, viewCount) {
Answers
C.
constructor (body, author, viewCount) {
D.
constructor() {
Answers
D.
constructor() {
Suggested answer: C
asked 23/09/2024
Sorin Craia
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first