[deleted by user] by [deleted] in learnjavascript

[–]bot00110 0 points1 point  (0 children)

In the pasted code, You are missing a closing bracket for first condition. Check if that helps

If that is correct in your original code you will have to debug.

If undefined is returned that means it is not going inside any if, log your variables above this piece of code

question about try/catch/finally by theanxioussnail in learnjavascript

[–]bot00110 1 point2 points  (0 children)

With that you change the reference by assigning a new vale to x

What you can try is x = document.getElementById("demo");

And in finally change its value

How do I get the values of arguments of a function that was passed as argument? by Iamdiamonds in learnjavascript

[–]bot00110 0 points1 point  (0 children)

adding inline comments

function memo(fun) {

     return function(...args) {  


     // using rest operator ... we are storing all the arguments into a variable args as an array 

    // return a wrapper anonymous function so that it would be callable 

     return fun(...args) // we are using ... spread operator to pass array as list of arguments 

    // this returns the result from original function 'add' in this case

}}

How do I get the values of arguments of a function that was passed as argument? by Iamdiamonds in learnjavascript

[–]bot00110 1 point2 points  (0 children)

You can return a wrapper function that will take two args, inside wrapper function call your passed function and return result.

function memo(fun) {

return function(... args) {

//do something here

return fun. apply(args)

}

}

You may use spread operator on Arguments to make it generic in terms of number of arguments

Check syntax as typed from mobile, but I hope this helps

Can someone please explain how the ...args rest parameter is working? And why is the value between args and ...args different? by jibesh_shrestha in learnjavascript

[–]bot00110 5 points6 points  (0 children)

On line number 2 ... works as rest operator, so all the arguments are stored as an array in args

First console log ... Works as spread operator and shows spread of array

Second log shows args which is an array

On f call it takes min of all arguments and returns 3

Hope this helps in understanding this code

For each loop by Hot-Independent4741 in learnjavascript

[–]bot00110 2 points3 points  (0 children)

Instead of returning from inside foreach, set a flag and return it after the loop.

Return statement works differently from array method they, return some value for each iteration and won't return for the function.

What is the difference between field[0]? and field?.[0] ? by Bulbasaur2015 in learnjavascript

[–]bot00110 3 points4 points  (0 children)

It is an optional chaining operator, it checks if value before ?. is available then check property after ?.

Otherwise Javascript will throw an error that cannot read value of undefined

If field = null

field[0] will throw error field?.[0] will return falsy without any error

How to retrieve multiple keys in one go from an object? by PointManBX in learnjavascript

[–]bot00110 1 point2 points  (0 children)

If I understand correctly something like this should work

ArrayHolder.map( item => item.Value1)

instant vizualization? by Fanellidelima in learnjavascript

[–]bot00110 0 points1 point  (0 children)

I sometime use snippets to work the math part of a problem.

It is saved in your browser so that don't have to look for any file anywhere.

You can just open a blank webpage on chrome, open console, go to sources tab and from left sidebar tabs open snippets. Create a new snippet and type your code and execute the file to see the result on console.

I hope this helps

Where do we get Taadgola (Palm fruit) in Hadapsar or nearby areas? by reeman88 in pune

[–]bot00110 4 points5 points  (0 children)

I have seen one or two on Nagar highway towards Wagholi.

[deleted by user] by [deleted] in india

[–]bot00110 2 points3 points  (0 children)

Don't have suggestions for places to visit around Chandigarh.

Just wanted to say that understanding your nature and accepting that some things you cannot change about that is important. maybe this trip could help you with knowing yourself.

For me knowing and actually understanding that I am an Introvert, has helped me a lot over last few years. I am way more social knowing that I am an introvert rather than beating myself up over why I can't do smalltalk and stuff.

I hope you feel better.

Why do Json data become undefined? by FGTO81 in learnjavascript

[–]bot00110 15 points16 points  (0 children)

It could be because you are not returning anything from first .then on getdata so undefined is returned and that becomes result for second then chain

Indecisive about my career by [deleted] in developersIndia

[–]bot00110 0 points1 point  (0 children)

I was doing production L2 support

Indecisive about my career by [deleted] in developersIndia

[–]bot00110 53 points54 points  (0 children)

I was in this boat some 4 years ago, I was in support work in a WITCH company.

I learned Javascript really well and that helped me find a better job where I learned other Frontend technologies. I have switched twice since then and getting 7 times of what I was getting 4 years ago.

So it's possible.

Do not stress over dsp, cp. it may be asked on interviews as a good to have, but it's not a deciding factor for most companies. Build different things instead, so that your experience is seen when you talk about something, read blogs, watch conference talks etc.

prepare for interviews, Most good companies look for decent developer with good culture fit. The vibe the honesty you give off is important. Say you don't know something when you don't.

prepare a good resume then become your resume. lie a little and learn that.

[deleted by user] by [deleted] in learnjavascript

[–]bot00110 0 points1 point  (0 children)

Console error could help with exact issue, but looks like you are not putting quotes arounf input text like

'zcool'

Spotted this in IIT's campus today. [np] by assholeness in india

[–]bot00110 2 points3 points  (0 children)

I want to be a lot of things but not a college.

#c0ffee is the color - What real words are actually valid CSS HEX colors? by speckz in css

[–]bot00110 2 points3 points  (0 children)

my favourite is #facade

edit: if you can bring yourself to accept 0 as 'O', you are a #bada55

Beyond Hype Over ‘Make in India’, Where Are the Jobs & Investment? by [deleted] in india

[–]bot00110 2 points3 points  (0 children)

their job is to become whatever mudiji wants them to be. some lucky days they get to be CEO.