JavaScript

1965 readers
1 users here now

founded 1 year ago
MODERATORS
76
77
2
submitted 11 months ago by mac to c/javascript
78
18
State of JavaScript 2023 (survey.devographics.com)
submitted 11 months ago by mac to c/javascript
79
11
submitted 11 months ago by mac to c/javascript
80
81
82
 
 

Hello!

I am pleased to announce a new version of my Understanding JavaScript RegExp ebook. This book will help you learn JavaScript Regular Expressions step-by-step from beginner to advanced levels with hundreds of examples and exercises.

Links:

I would highly appreciate it if you'd let me know how you felt about this book. It could be anything from a simple thank you, pointing out a typo, mistakes in code snippets, which aspects of the book worked for you (or didn't!) and so on. Reader feedback is essential and especially so for self-published authors.

Happy learning :)

83
28
submitted 1 year ago* (last edited 10 months ago) by pastelmind to c/javascript
 
 

The next minor release of ESLint will deprecate core formatting rules. [The dev team] recommends you use a source code formatter [Prettier, dprint] instead.

84
85
 
 

I am currently trying to learn Javascript and am getting hung up trying to understand Regex. Does anyone have any good resources or recommendations for me?

86
87
88
89
 
 

Introducing Deno Queues - zero config, scalable messaging with a guaranteed at-least-once delivery. This new primitive builds on the foundation set by Deno KV, and is available today in the Deno JavaScript runtime and Deno Deploy.

90
91
92
93
 
 

This is a follow up to my previous article on how to get more TypeScript benefits in your JavaScript. This goes into how to add types using JSDoc or TypeScript declaration files.

94
16
submitted 1 year ago by mac to c/javascript
95
96
 
 

Finally, i found the official documentation of Javascript

97
98
 
 

async MediaUpload(photos : any[]) { const client = await this.Login() const full_photo_urls : string[] = photos.map((item) => item.full) let image_ids : string[] = []; full_photo_urls.forEach(async (image_url) => { const image_blob = await fetch(image_url).then(res => res.blob()) try { console.log("images are about to be posted!"); const image_res = await client.postMediaAttachment({file: image_blob}) console.log("Images were posted here"); console.log(image_res); } catch (error) { console.error(error); } }) return image_ids;

Runs Error block which results in this

{ failed: true, json: { id: '111037763715692057', type: 'image', url: 'https://files.botsin.space/media_attachments/files/111/037/763/715/692/057/original/c46fd6ce6b892c66.jpeg', preview_url: 'https://files.botsin.space/media_attachments/files/111/037/763/715/692/057/small/c46fd6ce6b892c66.jpeg', remote_url: null, preview_remote_url: null, text_url: null, meta: { original: [Object], small: [Object] }, description: null, blurhash: 'UEHo8yIm%gV?9Exv%fM{?u~qM_D%xvITM{xa' }, path: 'media', response: Response { [Symbol(realm)]: null, [Symbol(state)]: { aborted: false, rangeRequested: false, timingAllowPassed: true, requestIncludesCredentials: true, type: 'default', status: 200, timingInfo: [Object], cacheState: '', statusText: 'OK', headersList: [HeadersList], urlList: [Array], body: [Object] }, [Symbol(headers)]: HeadersList { cookies: null, [Symbol(headers map)]: [Map], [Symbol(headers map sorted)]: null } }, status: 200, rateLimit: 30 }

I am really confused given it gives me a status code 200 which means OK, but still says it failed??? I also used my debugging to understand this is the line where the error occurs

const image_res = await client.postMediaAttachment({file: image_blob})

also ignore the fact imageres is unused, I removed the code after it for testing since to ensure nothing else was causing the error

99
100
view more: ‹ prev next ›