These are chat archives for FreeCodeCamp/Help

22nd
Feb 2019
psyperl
@psyperl
Feb 22 08:02
what's the difference between Array(10) and new Array(10) .. both seems to do the same?
kinopotato
@kinopotato
Feb 22 11:37
Hi, why do people keep saying that I shouldn't chain commands with ternary in js?
command === "add" ? (
  console.log("adding new note"), 
  notes.addNote(argv.title, argv.body)
  ) :
it's working fine and some people keep saying that I should write in ternary, so what is it really? do I use ternary or what?
psyperl
@psyperl
Feb 22 11:59
i like ternaries
i use ternaries all the time :D
but i made sure there is no statement in sequence in there ..
kinopotato
@kinopotato
Feb 22 12:03
so my console.log, notes... isn't good?
psyperl
@psyperl
Feb 22 12:03
i can chain or do whatever in it .. but it would be a single expression and nothing more
well i am not saying that's not good.. but i wouldn't do it yeah
kinopotato
@kinopotato
Feb 22 12:04
hmm, mind sharing your reasoning why? I've never worked for a company or have been part of a team so I really don't know anything about good practices
psyperl
@psyperl
Feb 22 12:05
well i've never really work for a company nor being in a team either so .. what difference would my statement make? haha
kinopotato
@kinopotato
Feb 22 12:06
xD well still, maybe I'll see more clearly why my buddy doesn't want me to do it.
psyperl
@psyperl
Feb 22 12:06
but imagine
let x
if ( multiply === true ) {
  x = 10 * 10
}
else {
  x = 10 + 10
}
compare to
let x = multiply === true ? 10*10 : 10+10
kinopotato
@kinopotato
Feb 22 12:08
you don't have to do x = 10* 10??
oh because of let x
psyperl
@psyperl
Feb 22 12:08
result of ternary can be an assignment
kinopotato
@kinopotato
Feb 22 12:09
let x = multiply === true ? 10*10,  console.log("it's 100") 
                                                  : 10+10, console.log("it's 20");
psyperl
@psyperl
Feb 22 12:09
lol yeah.. that's what i would avoid haha
kinopotato
@kinopotato
Feb 22 12:10
hmmm, I guess I'll just have to play around with it
thanks dude :)
psyperl
@psyperl
Feb 22 12:10
i would do
const multiply10 = () => {
  console.log("it's hundred")
  return 10*10
}
let x = multiply === true ? multiply10() : 10+10
kinopotato
@kinopotato
Feb 22 12:11
that sorta defeats the purpose of being lazy tho, hahaha
psyperl
@psyperl
Feb 22 12:11
haha it's lazy if you need to multiply again somewhere in code :D
kinopotato
@kinopotato
Feb 22 12:12
hmm, so many things about coding is situational, I can't wait for AI to figure this shit out and replace me.
psyperl
@psyperl
Feb 22 12:13
well maybe you can be the one who code that AI ? never know
kinopotato
@kinopotato
Feb 22 12:14
ha, I should learn JS first, if I'm asking about ternary then any AI I make is bound to kill us all just because of its load times being so slow from spaghetti coding, haha
i mean, if you were born ugly, it's not your parent's fault that they're ugly. but if you make an AI and it's incompetent, then it would be right in resenting you. that's some meta stuff right there.
psyperl
@psyperl
Feb 22 12:15
lol
well people get better all the time.. is not easy not to code spaghetti after all
and for ugly folks .. they can always do plastic surgery :D
ugly or not usually came from the confidents though
hence there is that obfuscated code contest or whatever.. kinda like saying who can write the ugliest? lol
kinopotato
@kinopotato
Feb 22 12:17
what?! there's a contest for ugly code??????
how do you even judge that, lol
psyperl
@psyperl
Feb 22 12:17
lol no idea
kinopotato
@kinopotato
Feb 22 12:20
the website has a 90s look, it fits perfectly. haha
psyperl
@psyperl
Feb 22 12:21
yeah i think they've been doing that for more than a decade
since 1984? iirc
kinopotato
@kinopotato
Feb 22 12:21
I wouldn't be surprised if they didn't update the html. haha
psyperl
@psyperl
Feb 22 12:21
hehehe
kinopotato
@kinopotato
Feb 22 12:23
well any way good luck dude! happy coding 8D
psyperl
@psyperl
Feb 22 12:23
you too! :wave:
god of lotus
@1371289694
Feb 22 15:46
hello,friends
Christopher McCormack
@cmccormack
Feb 22 15:46
@1371289694 :wave: hello
Victor Popescu
@VicPopescu
Feb 22 15:46
hello
god of lotus
@1371289694
Feb 22 15:47
I want to insert an picture in my computer to my HTML
what should I do
<img src="file://C:\Users\Administrator\Pictures\源于手机的图片\13958.jpg" alt="">
Christopher McCormack
@cmccormack
Feb 22 15:48
@1371289694 you may only be able to see that locally on your computer, is that alright?
god of lotus
@1371289694
Feb 22 15:49
anyone can tell me What did I do wrong
Christopher McCormack
@cmccormack
Feb 22 15:54
@1371289694 you may need to escape the \ character:
<img  src="C:\\Users\\Administrator\\Pictures\\源于手机的图片\\13958.jpg" alt="">
Victor Popescu
@VicPopescu
Feb 22 15:56
@1371289694 you should keep your files somewhere in the project directory and use relative path, but if that is not an option then use the absolute path like @cmccormack is showing you
@cmccormackyou need to escape \ for a src?
I never escaped back slashes in src
Christopher McCormack
@cmccormack
Feb 22 16:00
@VicPopescu normally the path in the src is a /
but escaping the \ may be platform dependent
god of lotus
@1371289694
Feb 22 16:14
@cmccormack emmm it seems to be useless
Christopher McCormack
@cmccormack
Feb 22 16:15
@1371289694 worked for me locally, are you sure you are using the correct path?
psyperl
@psyperl
Feb 22 16:33
only way to truly escape the \ character is to use either Linux or Mac
Christopher McCormack
@cmccormack
Feb 22 16:39
@psyperl :) you can actually use / in windows just fine in the path
at least in the html img src
psyperl
@psyperl
Feb 22 17:13
:D
Robert Purcea
@RobertPurcea
Feb 22 17:39

Hello, ex FCC member here
I have an offer for you

I'm launching a course on how to get a remote programming job and the first 10 people that will PM will get half of it for free, in exchange for detailed feedback on it (normal price is 200$)

It is aimed at those who already know some programming, as I will only provide general pointers on that aspect. You don't have to be an expert, but not a complete junior either

Those living in low cost countries should benefit the most as you'll end up earning more than 5x your local average salary while benefiting from all the perks of remote work.
I'm already doing all that

Cheers

Victor Popescu
@VicPopescu
Feb 22 17:42
@RobertPurcea how about giving the first versions for free, being paid with the feedback already?
"Those living in low cost countries should benefit the most" if they have 100 dollars to buy something that "might" help them
Robert Purcea
@RobertPurcea
Feb 22 18:09

No teaching material can guarantee you'll succeed. We might be able to give you pointers to shorten your path, but hard work will always be necessary

I am not asking anyone for money, I am simply giving away content for some feedback to a community that once helped me too

Brad
@bradtaniguchi
Feb 22 18:28
@RobertPurcea Your post could be considered advertising, which isn't allowed in the chat
Victor Popescu
@VicPopescu
Feb 22 20:21
@RobertPurcea you just asked for money
or I got it wrong and you give free courses?