ga-wdi-exercises / js-data-types Goto Github PK
View Code? Open in Web Editor NEW[js]
[js]
https://gist.github.com/mosesadg/c2265fd35f2fbea573d6
Comfort: 4
Completeness:5
comfort:4
completeness: 3
Had to call it a night.
https://gist.github.com/jkoul/74ee53c899878651aa14
comfort: 4
completeness: 5
I seem to have gotten one wrong, but hopefully as we learn more methods and functions I will get a better hang of the less basic and less common ones.
Completeness: 5
Comfort: 5
https://gist.github.com/omarimayerswalker/5e3c67f5f15f8969dff6
https://gist.github.com/malissaromero/fc5f48333922505c17cb
comfort level = 4
completeness = 4 (I did not answer the last three questions.)
https://gist.github.com/jeffjones89/50882dc2a05920f26e53
Comfort: 4
Completeness: 5
Forked Repo: https://github.com/andersenek/js-basics-hw
Gist: https://gist.github.com/andersenek/2caa5275a0ceddb37274#file-basics
Comfort: 5/5
Completeness: 5/5
https://github.com/pdoulatshahi/js-basics-hw
comfort_level: 4/5
completeness: 5/5
Still need more time to learn JavaScript functions so didn't give comfort level a 5. Other than that, no problems.
comfort: 4
completeness: 5
Comfort_Level: 4
Completeness: 5
Observations: Everything was relatively straight forward, except question 9 involving .join & .split. That one really dove into the weeds.
Gist: https://gist.github.com/kscoulter/80e8c4d0cd864fbf4fb0
confidence: 4;
completeness: 5;
https://github.com/siltastic/js-basics-hw
Comfort Level: 4/5
Completeness: 4.5/5
I haven't completed the last question, I will continue working on it.
https://gist.github.com/aag6z/5367cd971e53cf98ca43
comfort: 5
completeness: 5
Here is the link to my my gist https://gist.github.com/08ae663159290b216ce9.git
Competency: 3
Completeness: 5
https://gist.github.com/englep10/f83489a0a77d8778912c
comfort-4
complete-4
Comfort: 4
Completeness: 5
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( 15 );
--Numbers; The function returns the type of code that was written
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( "hello" );
--String; The function reads the letters in the code, declaring it a string
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( [ "dog", "cat", "horse" ] );
--String; The function reads the letters in the code and declares it as a string form
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( NaN );
--NaN; The value NaN declares that it's not a number, because it's not in parenthesis it recognizes it in that same form
// What is the return value of the below code sample? Provide a sentence or two of explanation.
"hamburger" + "s";
--"hamburgers" the string is put together with addition
// What is the return value of the below code sample? Provide a sentence or two of explanation.
"hamburgers" - "s";
--"hamburger"; the string loses its "s" after the (-) operator
// What is the return value of the below code sample? Provide a sentence or two of explanation.
"johnny" + 5;
--johnny5; The string is recognized and places the 5 at the end of johnny to follow the rule
// What is the return value of the below code sample? Provide a sentence or two of explanation.
99 * "luftbaloons";
--NaN; these two types of data can't be multiplied because luftbaloons is a string and not a number
// What will the contents of the below array be after the below code sample is executed.
var numbers = [ 2, 4, 6, 8 ];
numbers.pop(); [2, 4, 6]
numbers.push( 10 ); [2, 4, 6, 10]
numbers.unshift( 3 ); [3, 2, 4, 6, 10]
// What is the return value of the below code sample?
var morse = [ "dot", "pause", "dot" ];
var moreMorse = morse.join( " dash " ); "dot pause dot dash"
moreMorse.split( " " );[dot, pause, dot, dash]
// What will the contents of the below array be after the below code sample is executed.
var bands = [];
var beatles = [ "Paul", "John", "George", "Pete" ];
var stones = [ "Brian", "Mick", "Keith", "Ronnie", "Charlie" ];
bands.push( beatles );[ "Paul", "John", "George", "Pete" ];
bands.unshift(stones); [ "Brian", "Mick", "Keith", "Ronnie", "Charlie" ]["Paul", "John", "George", "Pete" ];
bands.length -[ 1 ].pop(); [ "Brian", "Mick", "Keith", "Ronnie", "Charlie" ]["Paul", "John", "Pete" ];
bands[0].shift(); ["Mick", "Keith", "Ronnie", "Charlie" ]["Paul", "John", "Pete" ];
bands[1][3] = "Ringo";["Mick", "Keith", "Ronnie", "Charlie" ]["Paul", "John", "Ringo" ];
https://github.com/aag6z/js-basics-hw
comfort: 5
completeness: 5
Comfort: 4
Completeness: 5
https://github.com/segheysens/js-basics-hw
Directly view my answers in my commit:
https://github.com/segheysens/js-basics-hw/commit/5b34ada7b3c470e0279d4df99c7cd05b70fde326
comfort_level: 4
completeness: 5
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( 15 ); //This would return as 'number' because 'typeof' tests for variable type and '15' is a number.
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( "hello" ); //This would return as 'string' because typeof tests for variable type and "hello" is a string.
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( [ "dog", "cat", "horse" ] ); //This would return an object because this collection of strings is a composite variable type, and 'typeof' checks for variable type.
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( NaN ); //This would return as a number because 'NaN' is an irrational number that can't be written conclusively with finite numbers, but it's still classified as a number variable type, and 'typeof' checks for variable type.
// What is the return value of the below code sample? Provide a sentence or two of explanation.
"hamburger" + "s"; //This would yield "hamburgers" because '+' when used with strings is treated as a concatenator.
// What is the return value of the below code sample? Provide a sentence or two of explanation.
"hamburgers" - "s"; //This would yield 'NaN' because '-' is a mathematical operator for subtracting numbers, and both of these variables are strings.
// What is the return value of the below code sample? Provide a sentence or two of explanation.
"johnny" + 5; //This would yield "johnny5" because '+' when used with strings is treated as a concatenator, so '5' is parsed to string "5" and concatenated.
// What is the return value of the below code sample? Provide a sentence or two of explanation.
99 * "luftbaloons"; //This would yield 'NaN' because '*' is a mathematical operator for multiplying numbers, and both of these variables aren't numbers.
// What will the contents of the below array be after the below code sample is executed.
var numbers = [ 2, 4, 6, 8 ];
numbers.pop(); // [ 2, 4, 6]
numbers.push( 10 ); //[2, 4, 6, 10]
numbers.unshift( 3 ); //[3, 2, 4, 6, 10] and it would return the new length of '5'
// What is the return value of the below code sample?
var morse = [ "dot", "pause", "dot" ]; //Creates array morse with these three strings.
var moreMorse = morse.join( " dash " ); //Creates string "dot dash pause dash dot"
moreMorse.split( " " ); //This would create an object containing seperate entities split by every " ".
// What will the contents of the below array be after the below code sample is executed.
var bands = []; //Creates array 'bands'.
var beatles = [ "Paul", "John", "George", "Pete" ]; //Creates array beatles with the four listed strings.
var stones = [ "Brian", "Mick", "Keith", "Ronnie", "Charlie" ]; //creates array stones with the five listed strings.
bands.push( beatles ); //Pushes array 'beatles' onto the end of 'bands' which is initially empty, so it ends up being the same as 'beatles'.
bands.unshift( stones ); // Adds the stones array to the front of the bands array, which now contains both arrays: [["Brian", "Mick", "Keith", "Ronnie", "Charlie"]["Paul", "John", "George", "Pete"]]
bands[ bands.length - 1 ].pop(); //Yields the end string in bands, which is being 'popped' off because it's index = bands.length-1 : [["Brian", "Mick", "Keith", "Ronnie", "Charlie"]["Paul", "John", "George"]]
bands[0].shift(); //Yields the first string in bands, which is being removed via 'shift', leaving bands array as : [["Mick", "Keith", "Ronnie", "Charlie"]["Paul", "John", "George"]]
bands[1][3] = "Ringo"; //Yields the string "Ringo", and adds the string into the 2nd array (array of index 1) at index position 3, which is the end: [["Mick", "Keith", "Ronnie", "Charlie"]["Paul", "John", "George", "Ringo"]]
https://gist.github.com/rewarren/9b1a40e5a55c72a249dc
comfort_level: 4
completeness: 5
comfort level: 5/5 (I got a few answers wrong at first go, but some googling explained the results and everything makes sense)
completeness: 5/5
comfort_level: 4
completeness: 5
Comfort_factor: 3
Ease: Towards the end, not sure of my answers. 3.
comfort_level: 4
completeness: 5
band array homework
Comfort_Level: 4
Completeness: 5
Observations: Everything was relatively straight forward, except question 9 involving .join & .split. That one really dove into the weeds.
completeness 5
Comfort 4
Comfort: 5
Completeness: 5
comfort_level: 3
completeness: 3
Completeness 5
Comprehension 4
https://github.com/petergcutler/js-basics-hw/blob/master/basics.js
https://github.com/cameronfry11/js-basics-hw/commit/fc4025d58fe01e2cf88e3b475c014d1df9d31973
completeness 5/5
comfort 4/5
comfort: 4.
completeness 5.
completion_level: 5
comfort: 5
comfort_level: 4
completeness: 5
https://gist.github.com/isabellabrookes/2f24253c7659bbc3dea9
Comfort level: 4 (I hesitate to say 5 because I still had to look up things but I'm comfortable in theory/with Google)
Completeness: 5
Gist link: https://gist.github.com/nolds9/c93a94769c5f46be3785
comfort: 5
completeness: 5
https://gist.github.com/leighvarley/a944b755e49ed0605f93
completeness: 5
comfort: 4
Completeness: 5
Understanding:4
Link:https://gist.github.com/KevCole/174b1cd72ea114b574fe
https://gist.github.com/Curtismn87/4b989ffb843cc67f7182
comfort = 4
completeness = 5
comfort_level: 3
completeness: 5
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( 15 );
number
15 is a number.
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( "hello" );
string
the word hello is in quotes, and therefore is a string.
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( [ "dog", "cat", "horse" ] );
string
all three are strings
// What is the return value of the below code sample? Provide a sentence or two of explanation.
typeof( NaN );
undefined
NaN is neither a string, number, or boolean
// What is the return value of the below code sample? Provide a sentence or two of explanation.
"hamburger" + "s";
hamburgers
string + string causes js to recognize as cat
// What is the return value of the below code sample? Provide a sentence or two of explanation.
"hamburgers" - "s";
NaN
two strings are being subtracted, but the subtraction operations causes js to expect two numbers
// What is the return value of the below code sample? Provide a sentence or two of explanation.
"johnny" + 5;
johnny5
string + number causes cat
// What is the return value of the below code sample? Provide a sentence or two of explanation.
99 * "luftbaloons";
NaN
strings can not be multiplied by numbers
// What will the contents of the below array be after the below code sample is executed.
var numbers = [ 2, 4, 6, 8 ];
numbers.pop();
numbers.push( 10 );
numbers.unshift( 3 );
[ 3, 4, 6, 10 ];
.pop causes a removal of the last numer in the array
.push( 10 ) causes an addition of the number 10 to the end of the array
.unshift( 3 ) causes an addition of the number 3 to the front of the array
// What is the return value of the below code sample?
var morse = [ "dot", "pause", "dot" ];
var moreMorse = morse.join( " dash " );
moreMorse.split( " " );
answer before attempting "dotpausedotdash"
i thought join converted all elements of array into a string, and split removed the space between quotes
answer after attempting [ 'dot', 'dash', 'pause', 'dash', 'dot' ]
i re-checked the definition of split... so what i think happened is, split removed the spaces between quotes and then output a new array
// What will the contents of the below array be after the below code sample is executed.
var bands = [];
var beatles = [ "Paul", "John", "George", "Pete" ];
var stones = [ "Brian", "Mick", "Keith", "Ronnie", "Charlie" ];
bands.push( beatles );
bands.unshift( stones );
bands[ bands.length - 1 ].pop();
bands[0].shift();
bands[1][3] = "Ringo";
bands = [[ "Paul", "John", "George", "Pete" ]];
push adds contents of beatles to array
bands = [[ "Brian", "Mick", "Keith", "Ronnie", "Charlie" ], [ "Paul", "John", "George", "Pete" ]];
unshift adds contents of stones to front of array
bands = [[ "Brian", "Mick", "Keith", "Ronnie", "Charlie" ], [ "Paul", "John", "George" ]];
.length - 1 finds the length of the array (9) and subtracts it by 1, which equals 8. pop removes the eighth value of the array
"Brian"
.shift removed "Brian" from the array and returned the string "Brian"
[["Mick", "Keith", "Ronnie", "Charlie" ], [ "Paul", "John", "George", "Ringo" ]];
bands[1][3] = "Ringo" adds "Ringo" to the fourth [3] position of the second [1] array
comfort_level: 5
completeness: 5
https://gist.github.com/a6d938cc2371b6411f95.git
https://gist.github.com/pdavies88/a6d938cc2371b6411f95
comfort_level: 5
completeness: 5
completeness: 3.5
comfort:4
Had to call it a night. Need Sleep.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.