W3D5: Calm after the Storm

We were allowed to pick what we wanted to do with the next 2-day block. The choices were: React.js sprint, ECMA Script 6 sprint, Coffeescript sprint, or review anything that we learned up to this point. Having listened to the seniors' advice and feeling lazy, I chose to review the first day and start on the ES6 sprint tomorrow.

Preeeeetty chill day. I've found out that there are office booths on the first floor that we were allowed to use. Naturally, I took one and locked myself away the whole day coding away on those super-comfortable bean bags. I fancied comparing myself to Harry Potter and the Room of Requirements. 


As expected, having no guidelines on what task to finish really diminished my productivity levels. Youtube, articles, and social media were often checked. Internet, you evil temptress, you.


What we did today:
1. Toy Problem:

Deep Equality

Write a function that, given two objects, returns whether or not the two are deeply equivalent–meaning the structure of the two objects is the same, and so is the structure of each of their corresponding descendants.
it('should return false for two objects with different number of keys', function(){
    var a = { foo: 'bar', biz: 'baz' };
    var b = { foo:'bar' };
    deepEquals(a, b).should.be.false;
  });
  it('should return true for similar nested object properties', function(){
    var a = { foo: 1, b: { c: 3 } };
    var b = { foo: 1, b: { c: 3 } };
    deepEquals(a,b).should.be.true;
  });
  it('should return false for dissimilar nested object properties', function(){
    var a = { foo: 1, b: { c: 3 } };
    var b = { foo: 1, b: { c:'potato' } };
    deepEquals(a,b).should.be.false;
  });
  it('should return true for similar excessively nested object properties', function(){
    var a = { foo: 1, b: { c: { d: { e: 'potato' } } } };
    var b = { foo: 1, b: { c: { d: { e: 'potato' } } } };
    deepEquals(a,b).should.be.true;
  });

2. React.js lecture
I attended even though I wasn't going to do the React sprint.
3. Review
rewatch certain lectures, refactor previous sprints, go through optional readings, redo questions I got wrong on the self assessments, edit blog, organize e-mails

No comments:

Post a Comment