These are chat archives for FreeCodeCamp/HelpJavaScript

23rd
Aug 2018
Please help me with this...
catalin560
@catalin560
Aug 23 2018 08:14
@yashwp creating a infinite scroll yourself is not easy...
  • you need an event listener on scroll
  • you need to throttle that listener and this in my opinion is the hard part
  • you need establish the trigger conditions either check if trigger is in viewport or if viewport has reached part of page
  • finally after all items are fetched and there is nothing more to scroll disable all event listeners to save memory
I could recommend you a library that can easily tackle all of these points
Niraj Nandish
@Nirajn2311
Aug 23 2018 09:20
@catalin560 what's the library
catalin560
@catalin560
Aug 23 2018 09:34
@Nirajn2311 scrollmagic
Niraj Nandish
@Nirajn2311
Aug 23 2018 09:35
Thx
tundeiness
@tundeiness
Aug 23 2018 09:41

Hi guys...little help here please
```function updateRecords(id, prop, value) {

      for(let album in collectionCopy){
           if( id == album){
                for(let iter in collectionCopy[album]){

                     if(iter !== prop && collectionCopy[album][iter] !== ""){
                         collectionCopy[album][prop] = value; 
                     }

                     if(iter === prop && !(collectionCopy.hasOwnProperty(prop))){

                            prop = [ ];
                            prop.push(value);

                                collectionCopy[album][prop]; 
                     }

                     if( iter === prop &&  collection[album][iter] !== "" ){

                               prop.push(value);
                     }else {
                         delete collectionCopy[album][prop];
                     }

                }

            }
     }

return collection;
}

code passes only two 
here is the response

After updateRecords(5439, "artist", "ABBA"), artist should be "ABBA"
Cannot read property 'pop' of undefined
Cannot read property 'pop' of undefined
Cannot read property '0' of undefined
After updateRecords(1245, "album", "Riptide"), album should be "Riptide"
```
I ran it somewhere else and it worked and I'm now wondering when i am missing it on the FCC IDE?

alpox
@alpox
Aug 23 2018 09:43
@tundeiness DId you test all those test cases?
tundeiness
@tundeiness
Aug 23 2018 09:44
@alpox yes...on the other IDE it passes but on FCC it passes only 2
alpox
@alpox
Aug 23 2018 09:44
@tundeiness You don't really change the values in collectionCopy in the case if(iter === prop && !(collectionCopy.hasOwnProperty(prop))){
tundeiness
@tundeiness
Aug 23 2018 09:45
@alpox okay....
@alpox what am I missing out here
alpox
@alpox
Aug 23 2018 09:46
@tundeiness collectionCopy[album][prop]; does nothing
You just reassign prop to a new array and put the value in. Thats all you do
And that change will be lost
if( iter === prop &&  collection[album][iter] !== "" ){
    prop.push(value);
}
And here you try to push to a string
tundeiness
@tundeiness
Aug 23 2018 09:48
@alpox hmmm...let me try that
alpox
@alpox
Aug 23 2018 09:48
Except its still the same prop from above in which case it is an array but you just push a second time value - and it will be lost again
tundeiness
@tundeiness
Aug 23 2018 09:51
@alpox i am a bit confused here...which condition are you referring to please?

@alpox here are the conditions stated by FCC:
If prop is "tracks" but the album doesn't have a "tracks" property, create an empty array before adding the new value to the album's corresponding property.

If prop is "tracks" and value isn't empty (""), push the value onto the end of the album's existing tracks array.

If value is empty (""), delete the given prop property from the album.

tundeiness
@tundeiness
Aug 23 2018 10:00
More Help please?
alpox
@alpox
Aug 23 2018 10:46

@tundeiness

for(let album in collectionCopy){
           if( id == album){

This is clearly not necessary as you already know the id, you don't have to loop through for finding the id.

If prop is "tracks" but the album doesn't have a "tracks" property, create an empty array before adding the new value to the album's corresponding property.

You do not do that. You say that prop is a new array with the new value (basically [prop]) and nothing more. You do not add anything to the tracks array of the album. For this. you have to directly push onto the array in the collection.
You also don't test for the value "tracks"

If prop is "tracks" and value isn't empty (""), push the value onto the end of the album's existing tracks array.

You do not test for the value "tracks" until now. Also, you do not push anything to the array of the collection. You just push something onto prop (which is a string and not an array - so it doesn't even have a .push method)

If value is empty (""), delete the given prop property from the album.

You delete all properties which do not equal to prop instead of the entry which equals to the value of prop but is empty.

tundeiness
@tundeiness
Aug 23 2018 10:55

@alpox the reason I had this

for(let album in collectionCopy){
           if( id == album){

was that earlier on I had difficulty in my previous test code and when it was not working for me I had to use the above line of code first.

alpox
@alpox
Aug 23 2018 10:57
@tundeiness This doesn't justify using the for :D
tundeiness
@tundeiness
Aug 23 2018 10:58
@alpox well....seems I am going to have to start all over again going by this new insight.
Mark
@vinarius
Aug 23 2018 13:24
Good morning freeCodeCamp Javascript friends. I am looking into testing for the first time and was looking for suggestions on what your favorite framework is and why. Any thoughts? Thanks in advance!
alpox
@alpox
Aug 23 2018 13:39
@vinarius My favourite testing framework: https://jestjs.io/
And for e2e (end to end) https://devexpress.github.io/testcafe/
Mark
@vinarius
Aug 23 2018 13:40
@alpox thanks! Any particular reason why you like those specifically?
alpox
@alpox
Aug 23 2018 13:41
@vinarius jest bundles everything what the other known test stack (karma + sinon + mocha...) gives you and in my opinion, better.
It gives you a very neat testing interface and mocking abilities with a good reporter
testcafe is nice because it is one of the few which abstracts the waiting for the elements about perfectly and has many nice features like user roles etc.
Nightwatch is a nightmare compared to testcafe
Also, both of them have very neat documentation, you easily find whatever you need
At my current work, I introduced both of those testing frameworks in an already existing project and it works awesomely well - the team also likes the change
Mark
@vinarius
Aug 23 2018 13:46
ok cool, I am also looking to introduce automated testing to an already existing project
Can you describe the difference between jest and testcafe?
alpox
@alpox
Aug 23 2018 13:47
@vinarius They are for totally different testing strategies
Testcafe is for E2E testing (End to End).
It assumes to know nothing about the internals of your project and directly accesses the website. It then surfs through it to test use-cases.
Everything without knowing what happens internally - it tests user-experience and that the most important functionality works.
It tests the WHOLE system without isolation. API, Website etc. altogether
Jest on the other hand is made primarily for unit tests
It is for testing components/modules in isolation while faking the outside world through mocks
It therefore tests the internals of your system, one by one to go sure that the single components work as expected
Mark
@vinarius
Aug 23 2018 13:51
perfect, thanks so much
alpox
@alpox
Aug 23 2018 13:51
You can also do integration testing with jest - integration testing tests the boundaries between two systems. As example, you test if the frontend api module interacts in the right way with the backend api. This, however, I would not recommend to do too much
@vinarius A thing to be aware of is that E2E testing takes A DAMN LOT OF TIME
While unit testing (with jest) runs in a matter of a few seconds
Mark
@vinarius
Aug 23 2018 13:52
I am more interested in testcafe since I use notional data in dev
alpox
@alpox
Aug 23 2018 13:53
Well then, have fun with it :) But as I said, be aware of the long testing time
I currently have 29 tests with testcafe and they take 7.5 minutes
Mark
@vinarius
Aug 23 2018 13:53
can't be as bad as the last project I was on. E2E took about 3 hours for one run. man it sucked everytime something failed.
alpox
@alpox
Aug 23 2018 13:53
That sounds awful :D
Go sure that you can run single tests with testcafe
You don't have to run them all
Ofc. only if you set it up the right way
Mark
@vinarius
Aug 23 2018 13:54
yeah, i wouldnt use it if you couldnt
alpox
@alpox
Aug 23 2018 13:54
You have to use database fixtures for this and not depend on previous tests
Each test should work on its own
Also, go sure to use the Page Model
It makes your life way easier
@vinarius
Mark
@vinarius
Aug 23 2018 14:00
Guess I just added something else to my reading list! haha
tundeiness
@tundeiness
Aug 23 2018 14:11

now if the instructions say this

If prop is "tracks" but the album doesn't have a "tracks" property, create an empty array before adding the new value to the album's corresponding property.
what does it really refer to? I'm thinking if parameter supplied is "tracks" and the album object does not have "tracks" property do something?
or does it mean another thing I am not getting?

@alpox the above is for you...
Niraj Nandish
@Nirajn2311
Aug 23 2018 14:13
@tundeiness could you post a link to the challenge
alpox
@alpox
Aug 23 2018 14:13
@tundeiness It means that if there is no tracks property, you create one on the album with the value [ value ]
alpox
@alpox
Aug 23 2018 14:14
@tundeiness This means, the value of the tracks property must be an array with the sole element being the value in the variable value
Niraj Nandish
@Nirajn2311
Aug 23 2018 14:17
@tundeiness if the passed id doesn’t have a tracks array
Then you’re supposed to create one
tundeiness
@tundeiness
Aug 23 2018 14:18

@Nirajn2311 what about this:

If prop isn't "tracks" and value isn't empty (""), update or set the value for that record album's property.

alpox
@alpox
Aug 23 2018 14:18
@tundeiness That means that you just set the value to the given prop if the prop is not tracks
Niraj Nandish
@Nirajn2311
Aug 23 2018 14:19
If the passed prop is not “tracks” and if there is a value associated with the passed prop
Then you’re supposed to update it with the new value passed
tundeiness
@tundeiness
Aug 23 2018 14:20
@alpox okay...let me give it a try again...those statements aren't too clear.
@Nirajn2311 sounds clearer now...
alpox
@alpox
Aug 23 2018 14:20
@tundeiness Hmm they are, but one has to get used to the terminology
Niraj Nandish
@Nirajn2311
Aug 23 2018 14:21
@alpox but sometimes you have to follower the KISS method
Keep It Simple Stupid
tundeiness
@tundeiness
Aug 23 2018 14:21
@alpox maybe terminology...I don't really understand why this is taking me too long to figure out.
Niraj Nandish
@Nirajn2311
Aug 23 2018 14:22
It he same challenge took me around 5 mins to understand and pass it
So don’t worry
tundeiness
@tundeiness
Aug 23 2018 14:24
@Nirajn2311 five minutes? I could not even concentrate this one has taken me days...and it's not my first time of dealing with objects though. maybe it's as a result of my movement
alpox
@alpox
Aug 23 2018 14:32
@Nirajn2311 Hmm this is not KISS? :D to me it is
Bryan Xu
@bryanpalau
Aug 23 2018 14:41

Does anyone know why it takes two "=" for "if(mymessage==true)"

thanks a lot~

<script type="text/javascript">
function rec(){
var mymessage=confirm("are you alive?");
if(mymessage==true)
{
document.write("i am alive!");
}
else
{
document.write("i am dead!");
}
}
</script>

alpox
@alpox
Aug 23 2018 14:48
@bryanpalau I'm not sure if I understand your question
Bryan Xu
@bryanpalau
Aug 23 2018 14:49
@alpox like why there are two "=" in the "if(mymessage==true)"
sorry, I had a typo in the previous post
alpox
@alpox
Aug 23 2018 14:49
@bryanpalau Because only one = is an assignment operator and not a comparison
With = you assign a value from the right handside to a variable on the left handside
With == and === you compare values
=== is a strict compare (It compares also value types)
== is a weak compare (It does not compare value types)
"2" == 2    // true
"2" === 2 // false
Bryan Xu
@bryanpalau
Aug 23 2018 14:55
@alpox thank you so much, very clear explanation and helpful!
Jefferson
@jeffersonnnn
Aug 23 2018 14:56
guys what is it meant by one string being a permutation of another? Is it meant that one is an anagram of the other?
alpox
@alpox
Aug 23 2018 14:57
@jeffersonnnn abc acb bac bca .....
Jefferson
@jeffersonnnn
Aug 23 2018 14:57
@alpox i see you are still doing a fabulous job here. thank you for the last time you helped me through a challenge
alpox
@alpox
Aug 23 2018 14:57
These are permutations
@jeffersonnnn No problem :)
Jefferson
@jeffersonnnn
Aug 23 2018 14:59
@alpox i thought so too .... thank youu
alpox
@alpox
Aug 23 2018 15:07
@jeffersonnnn np
Jason Luboff
@JLuboff
Aug 23 2018 15:10
Morning
alpox
@alpox
Aug 23 2018 15:10
@JLuboff evening
Jason Luboff
@JLuboff
Aug 23 2018 15:11
How's it going?
alpox
@alpox
Aug 23 2018 15:15
So lala
Im alone in the office which is quite chilly but im already done with the tasks for this (and probably next) week and everyone is in holidays
Jason Luboff
@JLuboff
Aug 23 2018 15:15
So lala? Like.. so so.. not bad not great?
Christopher McCormack
@cmccormack
Aug 23 2018 15:15
heya
alpox
@alpox
Aug 23 2018 15:16
So I guess the next days Ill sit around and program some random stuff :D
Jefferson
@jeffersonnnn
Aug 23 2018 15:18
hi guys.
Jason Luboff
@JLuboff
Aug 23 2018 15:33
@cmccormack What up
@alpox Get paid to sit around, can't complain :)
@jeffersonnnn What up
Christopher McCormack
@cmccormack
Aug 23 2018 15:34
@JLuboff just waking up in my trench again
Jason Luboff
@JLuboff
Aug 23 2018 15:35
Sweet
What are you working on today?
alpox
@alpox
Aug 23 2018 15:36
@JLuboff thats one way to see it :D
Christopher McCormack
@cmccormack
Aug 23 2018 15:37
I don't even know haha right now doing some peer reviews, need to open some requests, need to work on setting up some cert based VPN stuff, etc...
you?
Jason Luboff
@JLuboff
Aug 23 2018 15:38
Mmm... testing out some Task tracking applictions (right now Microsoft Planner), so I can start tracking my tasks more efficiently. Need to work on some forms for our Intranet site (ew PHP) and then look into Flexbox. Study some SQL.. Possibly work on a laptop thats been sitting in my office for a month now
alpox
@alpox
Aug 23 2018 15:41
@JLuboff i noticed that there is just no good note/task tracking software out there that fits me :D I gave up the search
Although for pure tasks I kinda like the issues on gitlab although they are conceptually bound to projects
@JLuboff maybe something like Trello?
Jason Luboff
@JLuboff
Aug 23 2018 15:48
@alpox Eh my boss had asked me the other day on how I track things...and I said I keep them in my head lol so figured I'd give them a shot. Trying MS Planner and my wife suggested Asana.
I will look at Trello
alpox
@alpox
Aug 23 2018 15:49
@JLuboff Heheh I dont track them myself either. Tried it several times. Im really not the type for that :) at least not with such tools
Christopher McCormack
@cmccormack
Aug 23 2018 15:55
Trello is pretty great
Used it for my wedding
Jason Luboff
@JLuboff
Aug 23 2018 15:58
Well if you used it for your wedding, it must be good!
Christopher McCormack
@cmccormack
Aug 23 2018 16:01
yeah!
You can't argue those facts
I also supplement with pen and paper with a task list
Jason Luboff
@JLuboff
Aug 23 2018 16:04
Ya I'll write things on my whiteboard as well
Christopher McCormack
@cmccormack
Aug 23 2018 16:04
You should write some really confusing stuff on there, like difficult math equations
Jason Luboff
@JLuboff
Aug 23 2018 16:05
Currently I have several SQL related items on there...so...I'm sure thats confusing to most
Christopher McCormack
@cmccormack
Aug 23 2018 16:06
hehe
Jason Luboff
@JLuboff
Aug 23 2018 16:07
Temporal tables, pivots, joins, ranking functions...
Christopher McCormack
@cmccormack
Aug 23 2018 16:08
Can't wait until you catch the Janitor in there optimizing it all
Jason Luboff
@JLuboff
Aug 23 2018 16:09
hah
Flexbox works in IE 11 right? Quick search shows I may run into some minor issues, but overall should be okay?
Mark
@vinarius
Aug 23 2018 16:13
yeah flexbox works in ie11
Christopher McCormack
@cmccormack
Aug 23 2018 16:13
@JLuboff yeah the known issues here list the IE bugs but don't seem too bad if you know what to look for
Jason Luboff
@JLuboff
Aug 23 2018 16:14
:thumbsup:
Thanks guys
Running through the FCC content then go from there
Jason Luboff
@JLuboff
Aug 23 2018 16:24
@alpox Hey, I've seen that before! Thanks
Jefferson
@jeffersonnnn
Aug 23 2018 16:50
okay help? i want to add and multiply a variable and have it equal to another variable. Something like var fooTotal *= foo[i];
how can i do this?
Jason Luboff
@JLuboff
Aug 23 2018 16:52
Not sure I quite understand but the above would not be valid as fooTotal wouldn't have a value at that point
Jefferson
@jeffersonnnn
Aug 23 2018 17:05
@JLuboff how so?
Jason Luboff
@JLuboff
Aug 23 2018 17:07
You can't multiple by undefined
fooTotal is undefined there
Jefferson
@jeffersonnnn
Aug 23 2018 17:09
oh indeed haha. My apologies. Here is what the code looks like

function solution(a, b) {
    var foo = a.split("");
    var bar = b.split("");

    //foo
    var fooTotal = 0;
    for (let i = 0; i < foo.length; i++) {
        var fooTotal +*= foo[i]; 
        // return fooTotal;
    }

    //bar
    var barTotal = 0;
    for (let i = 0; i < bar.length; i++) {
        var barTotal +*= bar[i];
        // return barTotal;
    }

    if (title == alive) {
        return 'yes';
    } else {
        return 'no';
    }

}

solution("abegi", "igeba")
Jason Luboff
@JLuboff
Aug 23 2018 17:09
+*= is not a valid operator as far as I know
Also, you're using var fooTotal twice.. probably only want that once..
I'd think you'd want
fooTotal += foo[i];
fooTotal *= foo[i];
return fooTotal;
Jefferson
@jeffersonnnn
Aug 23 2018 17:11
@JLuboff indeed, that move is what i seek to correct.
@JLuboff :thought_balloon:
Christopher McCormack
@cmccormack
Aug 23 2018 17:14
@jeffersonnnn helps a lot to add more descriptive variable names btw
Jefferson
@jeffersonnnn
Aug 23 2018 17:14
@cmccormack haha i am looking to learn how to do this same thing.
@JLuboff so call fooTotal twice. Got it. Let me have a look-see
Christopher McCormack
@cmccormack
Aug 23 2018 17:15
not calling, assigning
@jeffersonnnn you can probably use fooTotal = (fooTotal + foo[i]) * foo[i]
Jefferson
@jeffersonnnn
Aug 23 2018 17:20
@cmccormack @JLuboff what i'd really like to know is how all values in an array, because that is what all this is for
Christopher McCormack
@cmccormack
Aug 23 2018 17:20
@jeffersonnnn how to store all values in an array?
you can append a value to an array using .push(value) method of an array
Jason Luboff
@JLuboff
Aug 23 2018 17:24
Ya, I'd use push. Then you can reduce the array later if need be into a single value
Jefferson
@jeffersonnnn
Aug 23 2018 17:25
@JLuboff @cmccormack my deep apologies. i meant how to add together all the values in an array.
Jason Luboff
@JLuboff
Aug 23 2018 17:26
Use reduce
Jefferson
@jeffersonnnn
Aug 23 2018 17:26
[1, 2, 3,4] equals to 10 kind of thing.
Jason Luboff
@JLuboff
Aug 23 2018 17:26
return arr.reduce((a, b) => a + b);
Christopher McCormack
@cmccormack
Aug 23 2018 17:26
@jeffersonnnn like @JLuboff said you can use reduce MDN
Jefferson
@jeffersonnnn
Aug 23 2018 17:27
jesus! yes yes. of course. ugh.
Christopher McCormack
@cmccormack
Aug 23 2018 17:27
or you can iterate using a for loop and keep adding to a sum variable
Reduce is great because it's harder to introduce side-effects
Jason Luboff
@JLuboff
Aug 23 2018 17:29
@cmccormack Obiviousily you've never seen my for loops, they're bullet proof
Christopher McCormack
@cmccormack
Aug 23 2018 17:30
haha I'm sure
Jason Luboff
@JLuboff
Aug 23 2018 17:33
No wierd side-effects there. The blob monster has always been there. I swear
Tiago Correia
@tiagocorreiaalmeida
Aug 23 2018 17:34
@JLuboff a bit late but what I normally do is use something to auto prefix in the end which helps with alot of browser issues
Jason Luboff
@JLuboff
Aug 23 2018 17:36
@tiagocorreiaalmeida Gotta give me some more context here, my short term memory isn't great :)
Tiago Correia
@tiagocorreiaalmeida
Aug 23 2018 17:38
flexbox
but Im not even sure if the chat is from today or yesterday.. ahah
today nm
Jason Luboff
@JLuboff
Aug 23 2018 17:46
haha ya just a few hours ago
Jason Luboff
@JLuboff
Aug 23 2018 18:03
Alright, helped all the little froggies get to their lily pads :joy:
Christopher McCormack
@cmccormack
Aug 23 2018 18:04
that last one took me a while, glad you got it so fast!
Jason Luboff
@JLuboff
Aug 23 2018 18:05
I thought it was going to take me longer than it did.
Going to start playing with it for our intranet site make my forms look nicer
Jason Luboff
@JLuboff
Aug 23 2018 18:49
Welp..no water to the building..so I get to go home earlier!
Brad
@bradtaniguchi
Aug 23 2018 18:51
idk why I got twitter on my laptop, damn thing is distracting me >.>
Pagnito
@Pagnito
Aug 23 2018 18:51
anyone know how i can include code character as just text in html
in jsx
Aditya
@ezioda004
Aug 23 2018 18:56
@Pagnito Wrap it in curly braces and use quotes, like this {"&#40;"}
Pagnito
@Pagnito
Aug 23 2018 18:57
@ezioda004 thnx
Kelechi Chinaka
@ke1echi
Aug 23 2018 19:00
:wave: @ezioda004 what are you currently working on?
Aditya
@ezioda004
Aug 23 2018 19:04
@ke1echi :wave:, doing mongodb course (basics and node.js one) from mongo university, learning DS and Algorithms and sometime doing FCC projects on weekends. What about you?
Kelechi Chinaka
@ke1echi
Aug 23 2018 19:06
cs50, ds and algo @ezioda004
Aditya
@ezioda004
Aug 23 2018 19:09
@ke1echi That princeton one?
Kelechi Chinaka
@ke1echi
Aug 23 2018 19:10
no.. but still on the list @ezioda004
Kelechi Chinaka
@ke1echi
Aug 23 2018 19:25
i think i would adopt during fcc projects during weekends too @ezioda004
Aditya
@ezioda004
Aug 23 2018 19:29
@ke1echi Sounds good, which section's project you'll start?
Simon Cordova
@gbsimon87
Aug 23 2018 19:30
Good evening.
Does anyone know of any React form validation libraries they might recommend?
Kelechi Chinaka
@ke1echi
Aug 23 2018 19:33
I'm currently on survey form project @ezioda004
Aditya
@ezioda004
Aug 23 2018 19:39
@ke1echi Ah I see, have to tackle those projects too, goodluck :)
Christopher McCormack
@cmccormack
Aug 23 2018 19:43
@gbsimon87 You can validate using the built-in stuff on the frontend and maybe use https://www.npmjs.com/package/validator on the backend
Simon Cordova
@gbsimon87
Aug 23 2018 19:48
I just need front end validation myself, which do you mean by the built-in stuff?
@cmccormack
Christopher McCormack
@cmccormack
Aug 23 2018 19:49
Inputs have validation
you can make stuff required, set min/max lengths, use a regex to parse the input, etc..
Simon Cordova
@gbsimon87
Aug 23 2018 19:51
I'm looking for something along the following.
A user types into a required field, then focuses out, everything is fine.
Say the user goes back to the required field, and deletes all the content, the focuses out, it should pop up the field required message
I hope that makes sense.
Christopher McCormack
@cmccormack
Aug 23 2018 19:53
oh you want it on change as well
Simon Cordova
@gbsimon87
Aug 23 2018 19:53
onchange yeah
after deleting all the content the user doesn't need to necessarily focus out, the required field message should appear
Christopher McCormack
@cmccormack
Aug 23 2018 20:00
I've not used any but there are several if you just search React Input Validation and maybe check the stars on github
you could probably cobble together a few functions to do it yourself though
Can reuse a blank or certain length function for many inputs
an email regex should be easy as well
Pagnito
@Pagnito
Aug 23 2018 20:11
how do i make an input increase in height as i type instead of the text staying in one line
Simon Cordova
@gbsimon87
Aug 23 2018 20:12
@cmccormack yeah I've looked around and found nothing stable.
I already started to build it myself, but making it abstract and highly reusable will be tough I think
I won't always know which field elements are present.
Christopher McCormack
@cmccormack
Aug 23 2018 20:17
@Pagnito use a textarea maybe
Pagnito
@Pagnito
Aug 23 2018 20:18
yea but text area has a fixed height
Christopher McCormack
@cmccormack
Aug 23 2018 20:18
ah I see
not sure if you can do it without JS
@gbsimon87 every input has a type doesn't it?
Brad
@bradtaniguchi
Aug 23 2018 20:23
isnt the text area re-sizable? Or am I thinking of something else
alpox
@alpox
Aug 23 2018 20:24
@bradtaniguchi Should be, yes
Brad
@bradtaniguchi
Aug 23 2018 20:24
Yea just check it is, but yea it wont do it automatically AFAIK
Pagnito
@Pagnito
Aug 23 2018 20:24
its resizable but its fixed size
if u type over its height it becomes a scroll
it doesnt keep wrapping
and increase height
alpox
@alpox
Aug 23 2018 20:25
I didn't yet see a component which would do what you say but I would say you are free to invent it :D
With some js ^^
Christopher McCormack
@cmccormack
Aug 23 2018 20:25
I remember that being a non-trivial thing to fix, I may have imlpemented it though let me check
Pagnito
@Pagnito
Aug 23 2018 20:28
im surprised there isnt a input with that type or w/e yet
Brad
@bradtaniguchi
Aug 23 2018 20:30
I mean anyone can scroll an input-box, not a deal breaker
alpox
@alpox
Aug 23 2018 20:31
Yea I didn't yet feel the need for it
Pagnito
@Pagnito
Aug 23 2018 20:31
i hate scrolling thru small textareas
alpox
@alpox
Aug 23 2018 20:31
Then make a bigger textarea which you can scroll :D
Pagnito
@Pagnito
Aug 23 2018 20:31
it makes lookin for something to edit a real pain in the ass for me
nah its not responsive friendly
alpox
@alpox
Aug 23 2018 20:32
I would argue that noone would want to edit a textarea on mobile anyway :D
Pagnito
@Pagnito
Aug 23 2018 20:32
plus i dont want a feed of posts with a bunch of huge comment boxes lol
yea exactly nobody got the patience to be scrolling around a lil box on mobile
alpox
@alpox
Aug 23 2018 20:33
Well I don't have the patience to edit anything that is more than one line
on mobile
Pagnito
@Pagnito
Aug 23 2018 20:34
i dont mean edit code, but lets say i posted a comment like on facebok
and i want to edit it
like cuz of a typo or something
alpox
@alpox
Aug 23 2018 20:35
Might be a valid use, idk. I wouldn't work with that still :D others might
If you need such an input, you are one of a very few I guess which is probably why they don't exist natively
But you sure are free to create one
@Pagnito I see that https://vuetifyjs.com/en/ has such a textarea where you can set auto-grow as an option. So there might be frameworks which do allow it
Brad
@bradtaniguchi
Aug 23 2018 20:38
I'm sure it can be done with some basic JS/CSS (idk how, but I'm sure it canbe done)
Pagnito
@Pagnito
Aug 23 2018 20:38
oof i never even heard of vuetify
alpox
@alpox
Aug 23 2018 20:38
@Pagnito I'm using it at work - its only for the use with VueJS
Its kind of good and we don't yet have a single line of CSS - but it also has some few bugs
Pagnito
@Pagnito
Aug 23 2018 20:38
yea i think itll be easy to do wit javascript, a few if staments and css +height
aah
so what do u think of vue js compare to react
i never used vue yet
alpox
@alpox
Aug 23 2018 20:39
@Pagnito I STRONGLY prefer react
Brad
@bradtaniguchi
Aug 23 2018 20:39
I feel like vue is just the new version of angularjs
Pagnito
@Pagnito
Aug 23 2018 20:39
lmao
alpox
@alpox
Aug 23 2018 20:39
But most people say something else
Pagnito
@Pagnito
Aug 23 2018 20:39
i guess im glad to hear that
lol
alpox
@alpox
Aug 23 2018 20:40
Most people I meet prefer VueJS or put it on the same level
Pagnito
@Pagnito
Aug 23 2018 20:40
how come u prefer react
alpox
@alpox
Aug 23 2018 20:40
I hate the reactive property model
(Opaque reactivity of changes)
Pagnito
@Pagnito
Aug 23 2018 20:41
do u mean like with data
alpox
@alpox
Aug 23 2018 20:41
Damn deleted it :D
Pagnito
@Pagnito
Aug 23 2018 20:41
lol
alpox
@alpox
Aug 23 2018 20:42
Well i really dislike that observable-model with opaque data tracking
Which makes non-trivial usage very complicated especially when you run into certain bugs which come out of it
When you run into bugs which are related to reactivity and its timing you just sit there and can do about nothing
Pagnito
@Pagnito
Aug 23 2018 20:43
hat do u mean by reactivity
alpox
@alpox
Aug 23 2018 20:43
In VueJS, all data in the components which make the view (html) update or which is written back to through an input, are "reactive" which means that changes to those objects are tracked
This allows you to change an object and the view (html) updates directly like "magic"
Pagnito
@Pagnito
Aug 23 2018 20:45
so like state?
alpox
@alpox
Aug 23 2018 20:46
I really dislike it most of the time when frameworks just do "magic" because they work for the known usecases, say 95% of the time, and when you run in the other 5% they kick your ass and you have nothing left to help yourself because its all behind bars
Yes you could say state
Brad
@bradtaniguchi
Aug 23 2018 20:46
that's how I feel about angular :/
Pagnito
@Pagnito
Aug 23 2018 20:46
ah
i see
well i gotta go to the store, good talk ttyl
alpox
@alpox
Aug 23 2018 20:47
@bradtaniguchi Yea also the reason why I don't touch angular (Well I did. Terrible experience from my side...)
Brad
@bradtaniguchi
Aug 23 2018 20:48
I will admit I haven't found the bars you talk about tho, its just the apis are a jungle
alpox
@alpox
Aug 23 2018 20:48
@bradtaniguchi Well that too :D angular is terrible because of just the weirdest syntax they could think of
Brad
@bradtaniguchi
Aug 23 2018 20:48
yea, there's like 3 different micro syntax for things too
alpox
@alpox
Aug 23 2018 20:49
And also, state everywhere... ofc. not so much of a problem if you have devs which know what they do, but let one junior on an angular project and you end up with a mess
Brad
@bradtaniguchi
Aug 23 2018 20:49
Yup, I can see that for a lot of things tho
alpox
@alpox
Aug 23 2018 20:49
Yes, sadly. Its not easy to find something where that happens less
I'm opting for clojure now - seems things are a bit better there
Brad
@bradtaniguchi
Aug 23 2018 20:50
yea, I'm not about to jump ship for clojure yet, still seems to much like a cult XD
alpox
@alpox
Aug 23 2018 20:51
Haha I don't care much if it is or not :D I worked my way into it and I have to admit, from all the languages I've seen, clojure is still the best in design
Like the language I was always looking for :D
So I went into it because I was curious and I stay because I really like it :D
If cult or not, not my business :D
Brad
@bradtaniguchi
Aug 23 2018 20:53
I have a hard enough time getting my work and their clients to use java 8 over 7, and id be dreaming to try out a python backend or anything but java. So clojure is a fantasy
alpox
@alpox
Aug 23 2018 20:54
@bradtaniguchi Uhh i feel you
I don't touch java if I can avoid it (even though I don't have a problem with it when it comes to skill)
And still, if java, holy hell not java 7
I'm just learning and practicing clojure when I find some time at home in between, at work I'm involved with VueJS
Brad
@bradtaniguchi
Aug 23 2018 21:09
most of my home time is spent reading about docker, been trying to rid up some e2e tests to a dockerized mongodb database. Be the ultimate testing utility
alpox
@alpox
Aug 23 2018 21:13
Good luck there :) should work out somehow
I did the whole week nothing else than writing e2e tests...
Brad
@bradtaniguchi
Aug 23 2018 21:14
That's my goal at this point, but gotta get docker to work out :/
alpox
@alpox
Aug 23 2018 21:20
@bradtaniguchi Sure :) but you learn a lot along the way
I gotta give docker more attention again too soon
Eduard Cozma
@mecozma
Aug 23 2018 21:59

hi guys i completted the " Basic Algorithm Scripting: Confirm the Ending" challenge using this code 'function confirmEnding(str, target) {
let strArray = str.split(" ");
if (str.match(target + "$")) {
return true;
} else {
return false
}
}

confirmEnding("Bastian", "n");' do you think is valid?

Aditya
@ezioda004
Aug 23 2018 22:03
@mecozma Seems fine, you didnt use strArray in your code, so no point in splitting the string.
Eduard Cozma
@mecozma
Aug 23 2018 22:04
@ezioda004 yes, indeed. I forgot to delete it after i tried different options :P
Aditya
@ezioda004
Aug 23 2018 22:06
@mecozma Also, if you're comfortable with ternary operators then you can make your code more concise like:
return str.match(target + "$") ? true : false;
Eduard Cozma
@mecozma
Aug 23 2018 22:08
Thats true. Just I still have vanilla js embeded in my brain. But I think I ll get there...
Aditya
@ezioda004
Aug 23 2018 22:10
Yeah, sticking to basic syntax is perfectly fine, in time you'll pick up new/shorthand syntax/ways to do the same stuff.
Eduard Cozma
@mecozma
Aug 23 2018 22:10
cheers
Christopher McCormack
@cmccormack
Aug 23 2018 22:11
Conditional operator is Vanilla JS @mecozma
Eduard Cozma
@mecozma
Aug 23 2018 22:11
I didnt say it isnt just I thought ternary is some newer stuff...
Christopher McCormack
@cmccormack
Aug 23 2018 22:12
Aditya
@ezioda004
Aug 23 2018 22:13
I learned ternary first in python, they had weird syntax for it.
Eduard Cozma
@mecozma
Aug 23 2018 22:14
I know that too, just i didnt use it because I m not confident with the latest additions of js
Christopher McCormack
@cmccormack
Aug 23 2018 22:15
I'm saying it's not a latest addition
goes back to 1997
Eduard Cozma
@mecozma
Aug 23 2018 22:15
thank you
after this con i m sure i ll remember this for a long while :)
Christopher McCormack
@cmccormack
Aug 23 2018 22:21
@ezioda004 I think that's where I used it first as well, something like true expression if evaluates to true else false expression
starts to make more sense that way when using comprehensions though
Aditya
@ezioda004
Aug 23 2018 22:24
@cmccormack Yeah it took me sometime to wrap my head around (same as list comprehension)
Christopher McCormack
@cmccormack
Aug 23 2018 22:26
heh yeah I look at a comprehension now and it makes so much sense I have no idea why old me didn't get it at first
young me? whatever
I'm out early - see you later!
Aditya
@ezioda004
Aug 23 2018 22:31
:laughing: Thats how I felt too
See ya :wave:
Pagnito
@Pagnito
Aug 23 2018 23:03
anyone ever run into this
Actions must be plain objects. Use custom middleware for async actions.
im guessin i have to mke both my api calls in one action
Pagnito
@Pagnito
Aug 23 2018 23:10
it seems i was right