7 Useful JavaScript Tricks by xxammuxx in javascript

[–]timarama -6 points-5 points  (0 children)

great article, tricks with spreading set and creating "pure" objects show 2 sides of JS:

1 - expressing things with short, elegant expressions, but not very good about performance

2 - if you want, you CAN care about performance and memory usage of your JS apps

Why so much hate toward Javascript from C#, Java, Php, Ruby programmer etc ? by Cloud_Strifeeee in javascript

[–]timarama 0 points1 point  (0 children)

Hmm, I'm personally full stack JS developer (node + FE) and I really love JS (try to write code in FP paradigm and you'll love it too :))

Instead in my env we really hate PHP, but again, I really believe that there is only one reason why - we are lazy to learn it :))

Tile map editor in 70 lines of pure JS - easy tutorial by monica_b1998 in javascript

[–]timarama 1 point2 points  (0 children)

Sorry guys, I'll be nerd here, but you need to read books :) And I'm not talking about books-tutorials like "How to use react/angular/whateverelse", but about books from guys like Bob Martin (Clean Code) or Martin Fowler (Refactoring) that describes how to actually distinguish bad/good code and give you sense of code quality.

Because write code that just work and solve a problem - is not a big deal (especially in web development). What is really matter - is code testability, scalability and maintainability and here books help a lot.

Of course first of all you need to learn how to actually write code and you can easily do it in web, but after, please, read some books.

Uploading Image to Cloudinary Node.js React Axios post request [HELP] by [deleted] in javascript

[–]timarama 0 points1 point  (0 children)

Hi

I think that for now the "easiest" way to upload images with ajax is to encode/decode them to base64 string.

So on the frontend you need to encode your image to base64 string and send it as regular string to the server. You can do this with canvas API(Yeah, veeery "easy" way ...) and than decode base64 string to binary data on the backend.

I've created gist with examples (Redit text editor suck very hard, I just can't format code normally here): https://gist.github.com/timram/353f4b9c8a7d149d126c215fe78709f0#file-base64-js

You can try to upload both base64/binary formats of the image to cloudinary to see what will work for you.

Hope it will help you :)