DEV Community

Discussion on: JavaScript OR Assignment Operator

Collapse
 
stefanovualto profile image
stefanovualto

Here is the related documentation:

developer.mozilla.org/en-US/docs/W...

Thread Thread
 
acroynon profile image
Adam Roynon

Thanks, it seems like a more strict version of the OR assignment operator. Perhaps I shall create a post comparing the two

Thread Thread
 
stefanovualto profile image
stefanovualto

I think that you should point out the differences between falsy values (cf. developer.mozilla.org/en-US/docs/G...) and null/undefined checks (with ??). I think that will add value to your post.

Thread Thread
 
acroynon profile image
Adam Roynon

I think I shall leave this post as it is for now and cover the falsy values and the coalescing operator in separate posts, thank you for the feedback and ideas

Thread Thread
 
stefanovualto profile image
stefanovualto • Edited

Up to you, I just recommend you to be careful with the terms that you use in your post and in my opinion it is a good to support your posts with official references.

For example you function:

function getNotNull(a, b){
  if(a){

Doesn't work if you pass to it a falsy value like 0 or an empty string.

By being not precise you will assume wrong things (I have been there so many times, and it is still happening).

I would recommend the "you don't know js" by Kyle Simpson (@getify ), to expand your knowledge.

Thread Thread
 
acroynon profile image
Adam Roynon

Thanks for all the feedback. My plan isn't to fill every post with all the detail needed, at least not right now (I don't have the time to put that much time into each post). I mainly want to encourage people to begin to learn how to code, or experiment with something they haven't used before. I don't admit to knowing everything, but I don't want to overload the reader with too much information that reduces their interest in code. Again, thank you for all the feedback, I super appreciate it and I guarantee some readers will benefit from some of the links you've posted.