Create a new object with an array of properties vimeo
Here is an example of creating a new object with an array of properties in JavaScript:
const video = {
title: "My Video",
description: "This is a test video",
tags: ["vimeo", "video", "test"],
categories: ["music", "entertainment"],
duration: 300,
views: 0,
comments: []
};
In this example, the video
object has the following properties:
title
: a string property with the value "My Video"description
: a string property with the value "This is a test video"tags
: an array property with the values ["vimeo", "video", "test"]categories
: an array property with the values ["music", "entertainment"]duration
: a number property with the value 300 (which represents the video's duration in seconds)views
: a number property with the value 0 (which represents the number of views the video has received)comments
: an array property that is initially empty
You can access and manipulate the properties of the video
object using dot notation or bracket notation. For example:
console.log(video.title); // Output: "My Video"
video.tags.push("newtag"); // Add a new tag to the array
console.log(video.tags); // Output: ["vimeo", "video", "test", "newtag"]