0:00:24
what is going on guys welcome back to
0:00:26
another session of buildbreaking fix
0:00:30
one and only the raw coders
0:00:33
yes and today it's kotek and zayn at
0:00:47
web app off a camera board um
0:00:50
sorry about the hiccup um
0:00:52
i think i totally messed uh in trouble
0:00:58
yeah how are we feeling tonight okay
0:01:02
pretty good pretty good how are you
0:01:04
i am very good uh happy friday
0:01:27
of course i'm pretty much uh
0:01:30
a hell of a lot of stuff done
0:01:32
was very very productive on the work
0:01:35
side and on the personal side so far
0:01:43
pretty good i'm having nuggets and chips
0:01:50
is that your dinner is it
0:01:53
i don't know yet that's what i'm eating
0:01:56
if i feel hungry and then i'll eat again
0:02:02
um so uh first of all before we start
0:02:06
acknowledgement and then we can take it
0:02:08
from there all right so
0:02:12
i begin today by acknowledging the
0:02:14
traditional custodians of the land on
0:02:16
which we gather today and pay my
0:02:18
respects to the elders past present and
0:02:21
future i extend their respect to
0:02:23
aboriginal and torres strait islander
0:02:31
so i'll just give a bit of a brief
0:02:34
recap on what we go up to then finish
0:02:40
so what we did was we
0:02:49
the response that we were getting from
0:02:53
um it turns out the reason we can't
0:02:56
access that response is because it's
0:02:59
made up of strength
0:03:03
not an actual array
0:03:13
did actually open up pr as well on the
0:03:19
yes i did i did i did
0:03:22
get a really brief
0:03:24
moment to have a have a have a glance at
0:03:29
turns out that um i just actually show
0:03:34
tori did i think that
0:03:36
will be helpful for everyone
0:03:40
so i'll just open up the repo first and
0:03:42
then share my screen
0:03:46
by the way tori um i
0:03:50
as in written the change in
0:03:56
weren't supposed to be changed so i'm
0:04:00
not going to be accepting that um
0:04:02
pr but i'm pretty sure that um the
0:04:06
logic that you should apply
0:04:09
to that method can be applied to the
0:04:12
method that we're actually
0:04:14
working with with so yeah
0:04:19
there'll be one um
0:04:21
advantage of um as in
0:04:27
no i don't reckon is a waste of time
0:04:30
because even though the method is
0:04:32
different but they're both doing the
0:04:36
thing except they're
0:04:38
getting different content
0:04:45
logic should pretty much work in the
0:04:48
other method as well
0:04:49
all right um that being said
0:04:52
can you finish it show me the pr have no
0:04:56
whatsoever yes i was just gonna
0:05:00
do that because i'm handling the
0:05:02
comments and keeping track of everything
0:05:06
become a bit hard yeah i'll do the chat
0:05:10
while you eat so yeah i'll do that
0:05:25
um so can you see my screen now yep yeah
0:05:32
okay so the pr that tory little field
0:05:37
was this one and this was the change he
0:05:47
probably forget about the method
0:05:52
he changed this code into this
0:06:04
okay got it which file um
0:06:17
what's the problem again though
0:06:19
good so the problem was that we weren't
0:06:24
as an array object
0:06:26
back from the response
0:06:29
we were getting a string which we can't
0:06:32
really do anything with
0:06:34
what's the problem with tourist code
0:06:40
code is in the wrong method so the
0:06:45
wanna do it with is get both name
0:06:51
i think you can edit his pr
0:06:54
and then we can like
0:06:56
accept the same thing
0:07:00
if like if he's getting like
0:07:04
yeah um that would be actually a good
0:07:07
idea except i don't really know how to
0:07:11
do that some comment
0:07:14
changes so you have to
0:07:18
yeah just try to change that okay and
0:07:36
that's like the biggest
0:07:38
tech lead vibe like you can
0:07:45
true though then it's getting there
0:08:12
that that was the method that was not
0:08:14
returning a response
0:08:33
that method was returning a response but
0:08:36
wasn't working because of parsing errors
0:08:40
to get boards method
0:08:49
clearly i'm not on the same page as
0:08:52
story so what we can do is um okay
0:08:58
on call until you enjoy
0:09:03
actually would that be okay then
0:09:06
yeah for sure man um if you want to okay
0:09:16
i'll just stop showing
0:09:17
my screen to open open slack
0:09:20
yep interesting and
0:09:32
there we go there we go tori of this
0:09:39
tour is our part-time streamer now
0:09:45
fun to have him though
0:09:53
interesting names what
0:09:56
you won't accept my pr
0:09:58
that took exactly 20 seconds from me
0:10:00
saying let's get to it
0:10:06
oh my god oh my god let's have a
0:10:14
was because i didn't know that i can
0:10:16
actually comment and
0:10:19
ask you to change it that's
0:10:25
said it i didn't know you would take it
0:10:28
personal no i don't at
0:10:30
all i just thought it was funny i'm like
0:10:33
they're rejecting my pr how did they
0:10:37
yeah exactly how dare you i'm the most
0:10:39
expensive the devin valley you have no
0:10:42
idea how much time i spent on on
0:10:45
creating that method
0:10:49
yeah i know that was all i got 300
0:10:53
wow that's a lot of seconds in there as
0:10:57
yeah you don't accept that pr you owe me
0:11:06
i'll probably take you off for a coffee
0:11:10
what what did what did i mess up did i
0:11:17
the wrong function
0:11:20
i might not be on this
0:11:22
same pages to you then um so i'll just
0:11:24
share my screen again
0:11:30
right so the actual function that we
0:11:45
which we only want the board names and
0:11:48
then we want to interact with it
0:11:53
is that the same method that as in
0:12:00
i edited get bored but it's just like
0:12:03
i left it i left it generic
0:12:06
just to return a json object
0:12:09
like i didn't because i don't know the i
0:12:11
don't know the data shape i don't know
0:12:13
what it's returning
0:12:15
so basically i just created a fetch
0:12:20
just reuse i suppose forget methods
0:12:31
even though that um
0:12:36
shouldn't be in this method um
0:12:40
code the logic can be applied to us in
0:12:44
basically and and it's quite generic
0:12:49
yeah yeah it's it's just it's just if
0:12:53
if if i don't know what's on the other
0:12:55
end like i don't know what the server is
0:12:57
returning because i i got confused by
0:12:59
looking at some of the other functions
0:13:03
um because i don't know why
0:13:07
get bored by name is
0:13:09
looks like it's returning a json object
0:13:12
and then you're stringifying it
0:13:15
i'm a bit confused about that but
0:13:22
probably we are going in
0:13:27
what i can do is um
0:13:39
yeah yeah you can you can just if you're
0:13:41
returning a json object from the server
0:13:44
then this will work
0:13:46
um unless unless it's not the right url
0:13:50
for the end point but it it will this is
0:13:52
just like a generic fetch function you
0:13:54
can just rename it whatever you want it
0:14:08
i saved it yeah oh well done tori
0:14:14
thank you thank you this was the biggest
0:14:21
yeah i'm gonna put it on my
0:14:22
contributions list on my resume
0:14:25
heck yeah man i think that was basically
0:14:28
the purpose that um
0:14:35
project because it all
0:14:37
goes into our beautiful contributions of
0:14:44
all right cool so basically you're
0:14:49
would give me all the board
0:14:56
if i do hear console.log
0:15:13
sorry uh any chance you can meet your
0:15:23
all right here we go so testing on the
0:15:35
run the server on this
0:15:41
okay whoa took me straight there
0:15:44
that's not supposed to happen yeah
0:15:52
okay so if i press go i should see
0:16:20
writer that was one of the
0:16:23
things that we faced me and finished so
0:16:26
what i'm going to do is
0:16:40
actually didn't trick
0:16:52
come on i don't want you
0:17:07
now see what's happening because
0:17:10
now we actually using that method
0:17:14
oh so it's undefined
0:17:21
like can you access the
0:17:24
endpoint just put it in the browser and
0:17:25
try accessing the endpoint
0:17:34
i know what you're
0:17:38
trying to avoid that by
0:17:41
doing as in a fast track about yes
0:17:44
no way board board names yeah that
0:17:47
should be fine because oh hang on
0:17:51
there's a space there
0:17:54
um that shouldn't be a problem actually
0:18:00
i'm particularly interested in accessing
0:18:02
the board names endpoint
0:18:07
what id is not valid
0:18:10
that is interesting
0:18:26
hey get this how's it going
0:18:46
on the days in the one only too hard to
0:18:53
when is it as a 400 so it's the wrong
0:18:57
from there first of all
0:19:04
yeah which would be
0:19:14
board names isn't working anywhere like
0:19:17
even in uh um postman so it's something
0:19:20
in the back end first
0:19:24
board id is not valid
0:19:27
it's saying try doing an enforcement
0:19:48
all right here we go so
0:19:51
is the endpoint right
0:20:06
and point was wrong
0:20:12
one and then board
0:20:14
and then board names
0:20:17
um why would you do that there no no
0:20:20
sorry my bad my bad yeah yeah
0:20:22
we've been that way
0:20:24
dory did you see that it's your name
0:20:44
i'm not angry anymore if you urge that
0:20:50
i'll be happy happy dev effectively
0:20:57
okay so this is coming up but
0:21:02
if that's okay so which means
0:21:06
that on the first instance
0:21:13
on the first ever instance
0:21:16
this one is being consoled all locked
0:21:22
which means that we do get
0:21:47
probably do what story
0:21:50
in the first place but in the wrong
0:22:00
returning it right very good
0:22:04
got it yeah i got what you're doing
0:22:13
array and that's going to be stored in
0:22:17
and then we are simply
0:22:21
i want to check the type of the board
0:22:24
names and the actual
0:22:36
that is going to be interesting
0:22:41
it's coming up as objects which is
0:22:45
fine because it is an object
0:22:48
based on objects of red so i think we
0:22:53
string stringify this object because it
0:22:58
that's where i think tory had a bit of
0:23:02
as in why are you doing this so if we
0:23:07
uh i'm assuming you have a better way
0:23:10
tori how would you
0:23:12
suggest that if we shouldn't just
0:23:17
json object to see all the contents of
0:23:38
response is coming in in
0:23:46
return boards objects and then so it
0:23:48
should be running returning a json
0:23:56
in the board names because it is and
0:24:06
unless we stringify
0:24:08
the object we can't see its content
0:24:13
but we want to be able to access the
0:24:15
content of this object
0:24:21
okay so nothing's happening to it
0:24:24
it's just you're just trying to log it
0:24:30
essentially i want to be able to
0:24:34
see the the content of it being stored
0:24:49
like object object in javascript if i'm
0:24:52
not mistaken means it's a string version
0:24:57
but it shouldn't be because we've
0:25:03
i'm not following you now
0:25:10
i thought that's what it is um but
0:25:14
what if you what if you
0:25:18
so what what happened when you logged it
0:25:19
inside of that that function
0:25:22
um the the fact that an object
0:25:25
comes as an object
0:25:27
no i mean inside of the fetch inside of
0:25:29
that get boards method
0:25:37
over here you mean
0:25:39
yeah did you log out comes yes and it
0:25:45
okay so i think i think if you just if
0:25:48
you just console log it without the
0:25:52
bores dot arrow thing like maybe that's
0:25:56
the problem i don't know maybe it's a
0:25:58
weird thing with console logging in the
0:26:01
it can't be that because
0:26:05
log just shows you as in prints out
0:26:08
but but you're you're coercing it into a
0:26:11
string with that plus that's why i think
0:26:17
see that plus yeah when you do that in
0:26:19
javascript it's a you know a coercion
0:26:23
and then it's going to turn the object
0:26:28
but it's not turning the object into a
0:26:31
string it's just simply
0:26:34
outputting the object here as this but
0:26:44
okay so try this online just make a new
0:26:47
space on line 26 and just log out board
0:26:50
names without anything else
0:27:05
yeah you're in the board shows you have
0:27:08
there's there's all these like i i think
0:27:10
that's the problem because there's all
0:27:12
these there's all these you know
0:27:13
operators yeah see that's that's it it's
0:27:16
just turning it into a show
0:27:20
you're right i say
0:27:22
right right right right right
0:27:25
basically in javascript in in javascript
0:27:28
um everything if you concatenated to
0:27:32
us a string then it will also
0:27:36
turn it in into a string as well
0:27:38
yeah i can't remember exactly the exact
0:27:41
sequence inside the spec in js but like
0:27:45
i think if you have a string and a
0:27:47
number it's going to turn that number
0:27:50
and then if you have a string i think
0:27:52
the first thing it does if there's a
0:27:55
it's going to say turn this other thing
0:27:57
into a string but i don't know i'd have
0:27:59
to look at the spec
0:28:00
again right right okay
0:28:04
okay yeah i got you now what you could
0:28:07
do is instead of using the plus if you
0:28:09
just use a comma it should work
0:28:14
that's try that because i'm really
0:28:37
let's something new about javascript now
0:28:41
yeah yeah there's there's like you know
0:28:43
all these javascript operators that
0:28:46
you know are a little bit overloaded
0:28:49
you know so you have to be careful like
0:28:53
that makes sense yeah
0:28:58
that makes a lot more sense now
0:29:01
thanks for asking um
0:29:06
story i literally learned something new
0:29:09
javascript well this is this is what i
0:29:12
do all day every day is i work in pretty
0:29:15
much i only work in javascript so yeah
0:29:19
and type and typescript has helped me a
0:29:22
lot to avoid like some of these type
0:29:29
because it would yell at me if if i
0:29:32
tried to do something and then it's not
0:29:34
a an object anymore
0:29:36
because i coerced it to a string i mean
0:29:38
i think still in that instance but
0:29:41
right right i see yes
0:29:49
a lot of sense and
0:29:52
no wonder why everyone is as in going
0:29:59
dory you don't belong in this show
0:30:03
wow wow come on man be nice to each
0:30:13
are we still approving are we approving
0:30:21
commenting on that afterwards as well so
0:30:25
actually i'll just
0:30:35
there you go you've got your new name
0:30:54
yeah i mean i i do want to see how we do
0:30:57
the pr except i've never accepted the pr
0:31:00
the other guys pr i just didn't know how
0:31:03
okay but then i think there would have
0:31:14
so it's been about five weeks so
0:31:23
thanks kingdom oh yeah oh
0:31:28
don't scold reference yeah
0:31:30
you got a thousand views that's that's
0:31:36
i was a bit amazed like what personally
0:31:43
it's doing okay the video i think
0:31:50
thanks for the pr although the code
0:32:01
i'm gonna get dear friends
0:32:13
so i'm planning to like interview this
0:32:19
who spent 10 years in marketing
0:32:24
no sorry six years as a
0:32:27
grew in emirates and then four years in
0:32:30
marketing now he switched for data
0:32:33
so that was interesting
0:32:35
i wish you were here to really you made
0:32:37
a major pivot as well so i was trying to
0:32:40
put a video out for people who committed
0:32:43
was that on your your your stream
0:32:46
yeah i'm trying to put a little podcast
0:32:50
i want i want to do it in person so
0:32:55
if you want to fly down to melbourne
0:33:02
airplane can you get into australia no
0:33:05
no you can or you can yeah okay
0:33:08
two days ago you can
0:33:10
oh really just two days okay yeah
0:33:13
yeah so it might be a good idea to visit
0:33:20
they need to open up the air well they
0:33:22
did open up the airport they need they
0:33:24
need to have flights
0:33:26
they do it's you need to have the will
0:33:30
they have they have flights now direct
0:33:33
a thing to do with everything
0:33:36
because as far as i've heard so far
0:33:39
every day i check there's no
0:33:41
international flights that has come into
0:33:42
bali they've reopened since october 15th
0:33:48
yeah just no airline will take them up
0:33:50
on it or i don't know maybe it's also
0:33:55
okay yeah so right now they're expensive
0:33:58
but from february 1st
0:34:00
i can see very cheap um
0:34:08
quarantine in australia or no um sweet
0:34:17
no so it's not hotel quarantine um it's
0:34:20
three days but you have to do it at your
0:34:21
home like you can just stay in your
0:34:23
hotel or wherever you're staying
0:34:26
it would be a hotel right guys um
0:34:37
tori aden who who helped us
0:34:44
born name exactly as we
0:34:47
it all though in the method they
0:34:50
shouldn't have been but i've actually
0:34:52
commented on your um i've actually
0:34:56
asked for some changes in your pr so if
0:35:00
you can uh update the piano story and
0:35:05
review that again and finally approve
0:35:08
the pr your first pr of the project
0:35:14
okay yeah sure i'll i'll fix it what do
0:35:16
you want me to fix
0:35:21
no he said what what what do you want
0:35:27
the code is working fine but there has
0:35:31
to be in this method as in get boards
0:35:40
to get board names
0:35:47
get bored names okay
0:35:52
okay come on i'll just slack you because
0:36:10
all right i'll just change that
0:36:12
uh i'll change it into a switch
0:36:15
that's pretty much the reason it got
0:36:19
switch if response that okay
0:36:23
okay and we'll see trying to switch
0:36:29
instead of um these
0:36:42
and yeah you can just that should work
0:36:45
for all your get methods if you just
0:36:47
have it take a parameter in as your url
0:36:50
your prams whatever your slug
0:36:52
you can just reuse that get
0:36:54
method in fact you could reuse it for a
0:37:01
and then you could just have it
0:37:03
just yeah just return the json object
0:37:08
filtering whatever you need to do with
0:37:10
the object that comes out
0:37:15
now so that was a actually a really good
0:37:20
logic and the best part is that you made
0:37:26
not just suitable for this as in
0:37:29
specific scenario but it's actually
0:37:31
suitable for all this similar scenarios
0:37:37
yeah i get i get tired of of writing
0:37:41
inside of like react or something for
0:37:43
every component and it really just like
0:37:46
you just make a custom hook and then
0:37:48
it's just a fetch hook and then you just
0:37:50
throw in some parameters and you get
0:37:52
back where you want
0:37:54
what do you mean by that
0:37:56
i don't know how that works
0:37:58
um you make one hook
0:38:00
yeah it's it's just a thing in react you
0:38:02
can write your own hooks is what it's
0:38:05
called but basically it's kind of like a
0:38:07
generic well i wouldn't say a generic
0:38:11
function you can create and share across
0:38:20
uh which is it is it the purpose of this
0:38:22
function to do fetch
0:38:27
the purpose of this function is to fetch
0:38:29
data or uh yeah so you could you could
0:38:33
you could do something like
0:38:39
detective saying something but yeah you
0:38:41
can do something like use you could call
0:38:44
it like use fetch and then you can have
0:38:46
error states and loading states and and
0:38:50
then like return data
0:38:52
and so you can have like um
0:38:55
different components render based on um
0:38:58
the logic can react i don't know i like
0:39:02
i i mostly work in react so like i've
0:39:04
gotten used to more of the
0:39:12
is it like graphql what do you think
0:39:18
no no it's just like you know in
0:39:20
javascript you can write a function and
0:39:23
but in in re in react like if you
0:39:27
want to reuse a function
0:39:30
you should use context as sharing
0:39:34
yeah so you can make your own custom
0:39:40
reuse and share this
0:39:42
this hook across multiple components
0:39:45
throughout your application
0:39:49
that's great interesting stuff
0:39:52
i think we our project could have
0:39:55
from something like this
0:39:59
well just some simple refactoring you'd
0:40:02
be you'd be fine like
0:40:05
like because because if if i was gonna
0:40:08
give like in um if i was gonna go in and
0:40:12
refactor stuff i would just make like
0:40:15
kind of a generic fetch function
0:40:19
pass in like the method like if i wanted
0:40:22
to be post put patch i just put that in
0:40:25
as an argument with the headers
0:40:27
and and then out comes a json object or
0:40:32
something like that but
0:40:34
maybe for put in posts you maybe want to
0:40:38
function because like you may have
0:40:40
different things coming out of there or
0:40:47
it's interesting that you say that
0:40:48
because i remember when sam came in i
0:40:52
um zen if you remember he kind of said
0:40:57
um to create like a generate function
0:41:03
i remember it because i had a word with
0:41:04
him after that but we'll go ahead
0:41:09
continue yeah i just had a word with him
0:41:11
about this thing like he was also saying
0:41:13
maybe you guys should make a generic
0:41:15
function or just switch to
0:41:18
it was just interesting to think about
0:41:22
yeah well yeah graphql is like totally
0:41:25
different though um in terms of like
0:41:28
the whole like the whole server side so
0:41:34
um it does make the front end super easy
0:41:38
like it's not a big deal anyways it's
0:41:39
just kind of just like drying up the
0:41:42
instead of just like writing the same
0:42:00
i'll go i'll go i'll just hop off and
0:42:02
i'll just go fix that pr and then
0:42:05
i'll let you guys do your work i don't
0:42:06
want to i don't want to get
0:42:09
oh you muted yourself okay
0:42:13
fair enough tori thanks for that
0:42:15
yeah thanks for having me yeah
0:42:17
yeah nice to see you thank you for
0:42:18
coming up and for the pr though look
0:42:21
forward to receiving your changes
0:42:24
and then approving it thanks for taking
0:42:26
my changes all right thank you have a
0:42:28
good night guys thank you see you good
0:42:30
night juditory actually partially happy
0:42:34
youtube party happy neptune
0:42:36
because i didn't know when you didn't
0:42:38
accept spr but you said you will so
0:42:42
so he was partially happy oh okay okay i
0:42:46
yeah i thought that you first
0:42:52
as in real world then
0:42:57
logic is in if the logic is implemented
0:43:02
method as in the technology would not
0:43:05
accept appear at all
0:43:08
they will send it right back
0:43:09
so i just fought that
0:43:14
anyway i'm moving forward
0:43:18
um so where were we right so now that is
0:43:24
so the end result it works right
0:43:30
still have to interact with the
0:43:39
over here with the fine method
0:43:44
thing yeah we didn't make it work
0:43:47
i think i looked into it actually
0:43:51
and i looked into it while it worked
0:43:53
because we did kind of a similar thing
0:44:00
did you do with types i mean yeah
0:44:02
apparently the same thing
0:44:04
um he was fine only can't remember
0:44:34
this one and see if this works
0:44:38
yeah if it doesn't just go forward
0:44:44
i'm not making something
0:44:48
i literally am not
0:44:52
find this known function at goal
0:45:02
okay so same fine it's not functioning
0:45:10
i've already got this thing
0:45:12
i'm gonna check with the type of coming
0:45:26
ah so it's coming up as an object
0:45:34
yeah because find is is for arrays
0:45:55
to an array what is that object keys
0:46:05
object to an array
0:46:22
this is the same thing which we use for
0:46:27
checking if it's null or not if you
0:46:28
remember object names or that case
0:46:39
first name is john last name do
0:46:43
so basically this would mean
0:46:46
that we are property names is the
0:46:52
person in property okay
0:46:55
so however if we do
0:47:48
we need to check in this one
0:47:58
actually what does this
0:48:19
what's wrong with line 26 get that says
0:48:36
are not explained those schema of the
0:48:42
yeah so we don't need
0:48:50
items all right yeah okay that says do
0:48:52
object or values not object or keys you
0:49:00
my bad yeah yeah that makes sense
0:49:05
what was i thinking
0:49:15
first thing is an array second thing is
0:49:17
the length of the array
0:49:25
length of the array
0:49:26
yeah but we just need this one values
0:49:38
find that one and then just consolidate
0:49:40
log down items of this thing or that one
0:49:44
or something is it is it an array can
0:49:45
you show what the data structure is
0:49:54
yeah that might help
0:50:06
i mean you have to be
0:50:21
this is specially for arrays
0:50:25
see the issue is that we need to find
0:50:32
i don't know i think we might need to
0:50:34
take a longer approach
0:50:37
which means that this
0:50:40
destructing all this
0:50:44
i'll show you what i mean
0:50:50
instructing on this
0:50:55
to be in one array
0:50:57
right so you just want to do like a for
0:50:58
loop is that what you're saying
0:51:04
that will disrupt it and
0:51:10
okay we will probably have to do in that
0:51:19
the audience doesn't like for lu for
0:51:28
i mean i'm pretty sure we can
0:51:31
i don't know how we are not able to
0:51:34
good find in general
0:51:40
is only the function of an array but
0:51:44
this is apparently an object
0:51:51
um yeah i think like that's right we
0:51:53
should just use a debugger
0:51:56
we should have done that before but
0:52:02
see i think that's
0:52:04
was my tonight's task as an off stream
0:52:08
will be to set up a debugger
0:52:11
and yeah and use code
0:52:13
get live server as well while you do
0:52:15
that that i already have that
0:52:21
i did not that's pretty cool
0:52:35
let's just probably start
0:52:38
doing the custom array one
0:52:46
i'm just gonna try it one more time on
0:53:35
all right i'll take the values too oh
0:53:39
what did the values
0:54:15
why do you feel like that's not the best
0:54:17
way we can see what actually it is
0:54:22
because it might not be if you have a
0:54:26
yeah we just got see okay look at my
0:54:28
screen for just one second
0:54:37
look at this example
0:54:40
i can't see the monitor um the card
0:54:47
give me one second sorry
0:54:49
i'll make this smaller oh i can't
0:54:55
it's taking these restaurants in an
0:54:59
and then it's taking one restaurant
0:55:02
um that's not really the structure that
0:55:07
what structure do we have can we draw it
0:55:09
here so we have it um
0:55:14
if you draw it i think
0:55:17
yeah i was thinking about that
0:55:40
and then there's an
0:55:45
and then there's the first item
0:55:53
and our array of board
0:56:14
and then you duplicate that one
0:56:28
our structure at the moment
0:56:42
within the first index of that array we
0:56:50
and then in that row we have different
0:57:04
of an array of an object objects
0:57:10
right next array objects
0:57:13
yeah yeah so why can't we go to the zero
0:57:16
and element zeroth element and then
0:57:19
um access the object
0:57:23
i'm just trying to see
0:57:25
if you print the zeroth element of the
0:57:27
zero element what's gonna print
0:57:29
the controller login
0:57:37
to be honest i'm doing that many
0:57:40
oh except by the end of this
0:57:45
might be able to type console.log
0:57:59
try this first let's see what we get
0:58:12
actually hang on a minute i'm gonna do
0:58:31
stories wrote something undefined
0:58:35
or something in the chat
0:58:39
do you want to speak out to me
0:58:41
um it's a piece of code so i think it's
0:58:54
tried that we're already tori
0:58:59
uh read up okay the thing is
0:59:13
not showing up as an array apparently
0:59:24
so if you see here
0:59:37
all right i'm gonna probably work on it
0:59:39
in my own own time now okay yeah let me
0:59:46
but yeah like okay that's right it's an
0:59:49
object type yeah so i think we need to
1:00:00
how do we access it again
1:00:05
board names dot board board name
1:00:18
i think then refresh the screen
1:00:21
and there we have it okay that's
1:00:29
um right so where will we
1:00:38
actually i'm gonna
1:00:59
why don't you json stringify it for once
1:01:03
and see the actual structure in json of
1:01:08
how does that sound
1:01:19
just say some stringify board names
1:01:39
easy let's try this
1:01:40
it's larger follow me
1:01:50
i learned this trick from my senior dev
1:01:54
at my workplace putting arrows
1:02:10
okay so it's inside items so
1:02:17
dot board name dot items
1:02:20
board name sorry sorry sorry my bad says
1:02:24
print board name dot items at one at
1:02:27
zero try pinning that
1:02:38
yeah do not json stringify this and
1:02:40
let's see what happens
1:02:49
there you go you got the
1:03:01
that means that if i do items only you
1:03:06
should give me yeah
1:03:22
daddy that's your work
1:03:26
dot find inside the items
1:03:34
um in on line 24 only just try it there
1:03:38
oh actually yeah yeah do that there in
1:03:43
items items don't find items here don't
1:03:51
can you go ahead and construct
1:03:56
make this thing as value or something
1:04:05
do consult the log here
1:04:10
where your written board name would be
1:04:16
give it some other name
1:04:26
oh wait where is value defined
1:04:37
so can you do one thing
1:04:40
go online number 29
1:04:47
let or cons whatever
1:04:54
yeah um variable name item whatever
1:05:13
if you want to do it just tell me
1:05:15
oh i want to construct the json object
1:05:17
so do bracket open
1:05:30
yeah and whatever the board name is k1
1:05:32
or whatever that was
1:05:34
excited don't do the wrong brackets just
1:05:41
um the down brackets then
1:05:48
yeah you don't want the wrong brackets
1:05:54
at the end result yeah yeah yeah
1:05:57
yes and then do k1 in front of it and
1:05:59
put both of them in double quotes
1:06:11
double quotes yeah
1:06:13
not the whole thing both both of them
1:06:15
separately in double quotes
1:06:24
easy now semicolon
1:06:27
also items is already a thing
1:06:30
items oh wait that's nice no
1:06:33
okay fine instead of value now give
1:06:42
instead of k1 it should be value my bad
1:06:49
yeah it should be value
1:06:55
i think that should be fine yeah let's
1:07:06
well we need triple equipment
1:07:12
because it's just same data type right
1:07:19
everything has to match right let's try
1:07:22
that or we'll call it a night
1:07:41
and work should be
1:07:46
sorry man can you please put that on
1:07:49
yeah yeah i did i mute
1:07:55
oh that's t2 that's why
1:07:57
i think this is exactly how it should
1:07:59
well because what fine
1:08:02
does is if you can't find the input that
1:08:05
that we want in an array
1:08:08
it would give us undefined but if i do
1:08:13
k as in t2 it should give me t2 now
1:08:23
okay we'll come back to this tomorrow
1:08:24
now yeah um gekko says
1:08:29
please do it to our special tonight uh
1:08:32
i don't think so i can't give you
1:08:38
we will take that as a
1:08:40
challenge for some day
1:08:47
love to get there but i've already got
1:08:50
some as in very important commitments
1:08:53
unfortunately i can't really postpone
1:08:55
any longer otherwise i'll be in big
1:09:09
that one it will just probably be a
1:09:13
so sending them the data ship
1:09:20
upload uh i'll push
1:09:22
the code and you can probably send him
1:09:29
okay all right cool thanks guys thanks
1:09:32
thanks tori for joining in today
1:09:35
okay guys and yeah yeah um
1:09:39
tories are part-time streamer now yeah
1:09:41
yeah welcome aboard
1:09:44
that is incredible
1:09:53
and for value with your contributions
1:10:02
thanks for everyone for
1:10:11
come to a particular solution
1:10:15
still about to but it's
1:10:18
it's looking really promising
1:10:22
yes tomorrow uh actually not tomorrow on
1:10:25
sunday now as same place same time and a
1:10:31
yeah all right let me speak but that's
1:10:36
you were busy in your
1:10:43
no that sounds pretty good oh perfect
1:10:53
good night guys cheers