web development Flashcards
when creating an app or functionality for a webpage, should you use spaghetti code?
no you should have clearly defined functions for specific narrow objectives and code it that way so its clear what is going on for someone who is just scanning your code.
what is hardcoding?
during building your site or your app sometimes you need to just add a value or a piece of code to see if something is working properly in its implementation. This act of just randomly choosing some code as a value is called hardcoding.
The hardcoded code is always replaced later by the value from a function meant to produce one in its place once implementation goals are reached.
if a function has more than one parameter do we need to use all the parameters in our code in order for it to function?
no, a function can have 20 parameters but in a particular instance you only use one or two of them
what does the array method .join( ) do?
it takes the items in an array and turns them into a string
what does cuid( ) do? and how is it used?
cuid( ) creates a unique id number using an algorithim that is almost mathematically impossible that it will be repeated.
we can set cuid ( ) as a object value for an id key to create a unique id for an object.
let giants = { city : 'san francisco', name: 'giants', titles: 3, id : cuid( ) }
this whole object will take an id number thats specific to only it, it will be like 25 characters long
then you can use `${giants.id} to call that specific id back
how can we iterate through an array of objects and apply a specific attribute onto that object depending on whether a particular key value is true or false?
return <li class="${objectName.keyName"> ${item.name} </li>
for example :
return <li class="${item.happy"> ${item.name} </li>
this would look into an object and check to see which objects had a value of true for the happy key… any one that did would then have the hidden css declaration box applied to it. then the name of that item would be produced along with the li to add to a ul which would give you a list of every object in an object array that had a value of false for a happy key
what does the em tag do?
puts the text inside of it in italics
what does the s tag do?
it puts a straight line through the text in between the tags
what does the u tag do ?
it underlines the text that goes inside of the tags
what does the strong tag do?
it buts the content in between the tags in bold
what does the br tag do?
it creates a line break
how do you make the strikethrough effect in css?
text-decoration: strikethrough;
what does an hr tag do?
it creates a horizontal line along the length of an html document
does the hr tag have an closing tag
no it doesnt take one
what does box-shadow do?
it adds a shadow to the element selected.