Skip to content

Instantly share code, notes, and snippets.

View mdn102's full-sized avatar
🏠
Working from home

Minh Nguyen mdn102

🏠
Working from home
View GitHub Profile
@mdn102
mdn102 / game-loop ass
Created June 25, 2014 16:57
MinhNguyen/game_loop_ass
<script>
var random, tries;
var findDifference = function(answer, guess) {
if (answer > guess) {
return answer - guess;
}
else {
return guess - answer;
}
}
// #2
/*
Write an "assertArraysEqual" function from scratch.
Assume that the arrays in question contain only scalar values (i.e., simple values like strings or numbers).
Do not use JSON.stringify(), Array.join(), or any other "convert the array to a string so I can compare two strings" type of technique to implement this.
Examples
SUCCESS CASE
var expected = ['b', 'r', 'o', 'k', 'e', 'n'];
var actual = 'broken'.split('');
assertArraysEqual(actual, expected, 'splits string into array of characters');
/Assessment 1:
// Write a function wasItFunny which takes in a boolean argument (input value), and returns "meh" if the input was false, and "HAHAHA" if the input was true.
// function wasItFunny(response) {
// var response = true;
// if (response) {
// console.log("HAHAHA");
// } else if (!reponse){
// console.log ("meh");
//Exercise1:
// Write a function wasItFunny which takes in a boolean argument (input value), and returns "meh" if the input was false, and "HAHAHA" if the input was true.
function wasItFunny(response) {
if (response === true) {
console.log("HAHAHA");
} else {
console.log ("meh");
}
}
// BASIC ASSEMENT
// Exercise 1 (conditionals)
// Write a function lesserNum which takes in two integer arguments, and returns the lesser of the two. If they're equal, return either.
function lesserNum(num1, num2) {
// YOUR CODE HERE
var result = num1 ;
if (num1>num2) {
result = num2;
// Exercise 1
/* Write a function tallEnoughToRide which takes in an array of people objects, and returns a an array of names of people who are greater than or equal to 48 inches in height.
You can assume an input which looks like this:
var groupA = [
{
name: "Mia",
age: 10,
heightInInches: 52
@mdn102
mdn102 / AllUnderscoreMethods.js
Created April 22, 2020 21:58 — forked from alexhawkins/AllUnderscoreMethods.js
Basic Implementation of 'most' Underscore Methods from Scratch
var _ = {};
/*********IDENTITY**********/
_.identity = function(val) {
return val;
};
/*********FIRST**********/
_.first = function(array, n) {
@mdn102
mdn102 / Resume
Created September 30, 2020 22:16
MinhNguyen Resume
**# Minh Nguyen**
13301 SE 79th St, Suite B109 • Newcastle, WA, 98059 • (425) 951-9318
[Portfolio](https://minhdnguyen.com/) • [LinkedIn](http://www.linkedin.com/in/minhd-nguyen) • [Email](mailto:nguyendm77@gmail.com) • [GitHub](https://github.com/minhd-nguyen) • [Twitter](https://twitter.com/nguyendm77)
**CAREER SUMMARY**
Results-oriented, high-energy, hands-on professional, with 18+ years&#39; experience and a successful record of accomplishments in the software, hardware computer as well as in medical device and aerospace industries.