Skip to content

Tag: javascript

I need to use switch statment to return a word from the set of words

Complete the getLetter(s) function in the editor. It has one parameter: a string, , consisting of lowercase English alphabetic letters (i.e., a through z). It must return A, B, C, or D depending on the following criteria: If the first character in string is in the set , then return A. If the first character i…

How to download .js file by JavaScript from an url?

I know this question is asked hundreds of time in this forum, But I’m trying to download a .js file from an url in my Vue 2 application, but it’s not working. Here is what I’m trying: This downloads a file which consists nothing but the url I’ve provided to the axios post request. I&#8…

make mysql connection error in lambda, why?

I wonder difference to main, function environment nodejs 14.x mysql2 2.2.3 I made code, call pool.getconnection in main, it’s fine(success data from db) but can’t get a data from function. I wonder why this can’t get from function can’t find error log only find Promise pending.. Promis…

Typescript: Define for JSON nested object

I have a nested json object and define a interface for it But when I use it. It appear a warning. What did I do wrong or missing? Answer You didn’t do anything wrong per se. TypeScript just cannot infer whether your menuPermissionForKey is a Menu object or a string array. Ideally, you’d define you…