r/JavaScriptProgramming • • Dec 14 '23

I don't know how to mutate a function object. Need Help

2 Upvotes

Hi, I'm learning JavaScript and this is one of the exercises that I can't get through, I was hopping someone could guide me a bit.

You see I'm leaning Objects, this is what I have to do:

  • Add a new property to the pirateProfile
    called pirateName
    and set this to the value of 'Blackbeard'

  • Remove the realName
    property.

  • Change the value of piecesOf8
    on the treasure
    key to be 8 rather than 7.

  • Change the shipName
    property to its new value of Queen Anne's Revenge without changing the orinigal object.

  • This is the code given:

function createPirate() {
const pirateProfile = {
realName: 'Edward Teach',
shipName: 'La Concorde',
treasure: {
gems: 10,
piecesOf8: 7,
goldCoins: 150
}
};
return pirateProfile;
}
----

I literal tried to find how to mutate a function Object but without luck. And every time I write the way is taught like pirateProfile.pirateName = 'Blackbeard'
it gives 'βœ• ReferenceError: pirateName is not defined '.


r/JavaScriptProgramming • • Jun 13 '23

πŸš€ JavaScript Tip: Take Advantage of Destructuring Assignment

Thumbnail
self.welovecodes
1 Upvotes

r/JavaScriptProgramming • • Jun 14 '23

Guys! If anybody look into it

Post image
1 Upvotes

r/JavaScriptProgramming • • Jun 16 '23

πŸš€ JavaScript Tip: Use the Optional Chaining Operator (?.) for Safe Property Access

Thumbnail
self.welovecodes
1 Upvotes

r/JavaScriptProgramming • • Jul 21 '24

npm install stuck for hours also cause the hang of command prompt

Thumbnail self.npm
1 Upvotes

r/JavaScriptProgramming • • Aug 17 '23

πŸš€ Check out my latest React JS creation: Codeial - The Social Media Haven for Coders!

1 Upvotes

πŸ‘‹ Hey Redditors! πŸš€ Just unleashed my new React JS project - **Codeial**: the ultimate social hub for coders. πŸ”₯πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» Wanna be legends and help me test if it's alive? Click that link: [Codeial Live](https://codeial-26482.web.app/) Let's get coding, connecting, and critiquing! πŸŽ‰πŸ€ #ReactJS #Codeial


r/JavaScriptProgramming • • Oct 01 '23

Interview Question On Delete Operator | Frontend JavaScript Interview Questions |

Thumbnail
youtube.com
1 Upvotes

r/JavaScriptProgramming • • Nov 30 '23

Why & How To Use CSS Preprocessor | CSS Preprocessor Tutorials For Beginners | Rethinkingui |

Thumbnail
youtu.be
1 Upvotes

r/JavaScriptProgramming • • May 31 '23

Best JavaScript Frameworks for Mobile App and Web Development

Thumbnail
technource.com
1 Upvotes

r/JavaScriptProgramming • • Jun 11 '23

Helping for programming

1 Upvotes

I’m practicing javascript, but i don’t know after knowing about that, what i have to do. I wanna ask you what way you recommend for me?


r/JavaScriptProgramming • • Jun 11 '23

HTML & CSS & JavaScript || Interactive navigation bar animation tutorial

Thumbnail
youtube.com
1 Upvotes

r/JavaScriptProgramming • • Oct 11 '22

help anyone?

1 Upvotes

I need help with an assignment in javascript that is due thursday. Really struggling with this one. Can anyone help me. I have time this morning and tomorrow morning.


r/JavaScriptProgramming • • Jun 24 '22

Chrome extension for help read webtoon without need mouse - Reader Scroller

1 Upvotes

Hi guys, i created a chrome extension for us to scroll the page automatically, if you want to test access the link below

https://chrome.google.com/webstore/detail/reader-scroller/jimnlnomkbenehcaljonifgfocnogkha?hl=en&authuser=0


r/JavaScriptProgramming • • Oct 31 '23

Tree Shaking In JavaScript | Optimize Your Code and Boost Performance | RethinkingUI

Thumbnail
youtu.be
1 Upvotes