Skip to content

Commit

Permalink
fixed styling
Browse files Browse the repository at this point in the history
  • Loading branch information
madhuredra committed Sep 23, 2023
1 parent 59a6457 commit 830cd3c
Showing 1 changed file with 17 additions and 18 deletions.
35 changes: 17 additions & 18 deletions JavaScript/Classes/Shape.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* @author dev-madhurendra
*
*
* @class : In Object-Oriented Programming (OOP), a class is a blueprint or template
* for creating objects (instances). It defines the properties (also known as
* attributes or fields) and methods (functions) that the objects created from
* the class will have. JavaScript, starting from ECMAScript 6 (ES6), introduced
*
*
* @class : In Object-Oriented Programming (OOP), a class is a blueprint or template
* for creating objects (instances). It defines the properties (also known as
* attributes or fields) and methods (functions) that the objects created from
* the class will have. JavaScript, starting from ECMAScript 6 (ES6), introduced
* support for classes, making it easier to work with OOP principles in JavaScript.
*
*
* Represents a basic shape.
* @class
*/
Expand All @@ -17,37 +17,36 @@ class Shape {
* @param {number} x - The X coordinate of the shape's position.
* @param {number} y - The Y coordinate of the shape's position.
*/
constructor(x, y) {
this.x = x;
this.y = y;
constructor (x, y) {
this.x = x
this.y = y
}

/**
* Get the X coordinate of the shape.
* @returns {number} The X coordinate.
*/
getX() {
return this.x;
getX () {
return this.x
}

/**
* Get the Y coordinate of the shape.
* @returns {number} The Y coordinate.
*/
getY() {
return this.y;
getY () {
return this.y
}

/**
* Move the shape to a new position.
* @param {number} newX - The new X coordinate.
* @param {number} newY - The new Y coordinate.
*/
move(newX, newY) {
this.x = newX;
this.y = newY;
move (newX, newY) {
this.x = newX
this.y = newY
}
}

export default Shape

0 comments on commit 830cd3c

Please sign in to comment.