View Shouter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function shouter(whatToShout) { | |
// your code here | |
} | |
/* From here down, you are not expected to | |
understand.... for now :) | |
Nothing to see here! |
View Divisible
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isDivisible(divisee, divisor) { | |
return divisee % divisor === 0; | |
} | |
/* From here down, you are not expected to | |
understand.... for now :) | |
Nothing to see here! |
View Error drill
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function main() { | |
try { | |
doAllTheThings(); | |
} | |
catch(e) { | |
console.error(e); | |
reportError(e); | |
} | |
} |
View compete the average
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function average(numbers) { | |
var total = numbers[0]; | |
for (var i=1; i < numbers.length; i++){ | |
total += numbers[i]; | |
} | |
return total/numbers.length; | |
} | |
View In your own words
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
What is scope? Your explanation should include the idea of global vs. local scope. | |
A. Scope is the declaration and accesibility that is possible in javascript, i.e the local and global scope wherin the variables | |
get stored in a global way, that can accessed anywhere in the program or | |
a Local variables have ,They can only be accessed within the function. | |
Why are global variables avoided? | |
Global variables are avoided because it creates a fuss if we programming 1000s of lines of codes. | |
Explain JavaScript's strict mode? | |
Strick mode is a way of writing secure javascript. It helps us in avoiding globad variables. It will throw an error if the |
View deleting keys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function keyDeleter(obj) { | |
obj.delete='foo'; | |
obj.delete='bar'; | |
return obj; | |
} | |
var sampleObj = { | |
foo: 'foo', | |
bar: 'bar', |
View data merge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mergeDataStreams(stream1, stream2) { | |
var results = {}; | |
for (var i=0; i < stream1.length; i++) { | |
results[stream1[i].id] = stream1[i]; | |
} | |
for (var key in results) { | |
var otherData = stream2.find( | |
function(item) { return item.id === key; }); | |
for (var _key in otherData) { |
View cat carousel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function handleThumbnailClicks() { | |
$('.thumbnail').click(function(event) { | |
var imgSrc = $(event.currentTarget).find('img').attr('src'); | |
$('.hero img').attr('src', imgSrc); | |
}) | |
} | |
$(function() { | |
handleThumbnailClicks(); | |
}); |
View auth.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Error Codes for SignUp | |
ERROR_OPERATION_NOT_ALLOWED` - Indicates that Anonymous accounts are not enabled. | |
ERROR_WEAK_PASSWORD - If the password is not strong enough. | |
ERROR_INVALID_EMAIL` - If the email address is malformed. | |
ERROR_EMAIL_ALREADY_IN_USE - If the email is already in use by a different account. | |
ERROR_INVALID_CREDENTIAL` - If the [email] address is malformed. | |
// sending password reset email | |
ERROR_INVALID_EMAIL` - If the [email] address is malformed. |
View flutter_in_app_purchase.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:cloud_firestore/cloud_firestore.dart'; | |
import 'package:firebase_auth/firebase_auth.dart'; | |
import 'package:flutter/material.dart'; | |
import 'dart:async'; | |
import 'dart:io'; | |
import 'package:flutter/services.dart'; | |
import 'package:flutter_inapp_purchase/flutter_inapp_purchase.dart'; | |
import 'package:flutter_screenutil/screenutil.dart'; | |
import 'package:ielts/screens/home_screen.dart'; | |
import 'package:ielts/utils/app_constants.dart'; |
OlderNewer