get help in general - we have more specialized help rooms here: https://gitter.im/FreeCodeCamp/home
$("#temperature").on("click", switchunits);
$(document).ready( function() {
});
$("#temperature").on("click", switchUnits());
function getLocationAndWeather()
data.photos
Object {page: 1, pages: 4, perpage: 250, total: "771", photo: Array[250]}
OH, and I found this: "lat (Optional)
A valid latitude, in decimal format, for doing radial geo queries.
Geo queries require some sort of limiting agent in order to prevent the database from crying. This is basically like the check against "parameterless searches" for queries without a geo component."
<!DOCTYPE html>
<head>
<script src="/assets/jquery.js"></script>
<style>
</style>
</head>
<body>
<div class="prompt"></div>
<script>
var prompts = [
'Type your name',
'Type an adjective',
'Type a noun'
];
// alert(prompts.length);
// alert(prompts[0]);
// jQuery to insert an array-indexed item into the empty HTML div
$('.prompt').html(prompts[0]);
</script>
</body>
<!DOCTYPE html>
<head>
<script src="/assets/jquery.js"></script>
<style>
</style>
</head>
<body>
<div class="prompt"></div>
<script>
var prompts = [
'Type your name',
'Type an adjective',
'Type a noun'
];
// insert prompt into html
$('.prompt').html(prompts[0]);
//alert(prompts.length);
//alert(prompts[0]);
</script>
</body>
'''
//Coderbyte Problem 4 Easy- Letter Challenge
// still need to fix
// 1- finding ampersands in regular expression
// I can hack it with an if statement, but that's sloppy
// 2- special characters are shifting too,
// I want to exit that iteration of the for loop
// and add the special character in question to the new
// array
// 3- refactoring obviously
function main(){
// start
console.log("Enter string");
var str = prompt(" ");
// final output
console.log(LetterChanges(str));
}
function LetterChanges(str){
var strArray = str.split("");
var strNewArray = [];
for(var i = 0; i < strArray.length; i++) {
if (strArray[i].match(/[^\w]+/g) === true){
strNewArray.push(strArray[i]);
break;
} else if (strArray[i] === " ") {
strNewArray.push(" ");
continue;
} else {
var character = strArray[i].charCodeAt(0);
character += 1;
character.toString();
character1 = String.fromCharCode(character);
strNewArray.push(character1);
}
}
return strNewArray.join("");
}
main();
'''
'''
//Coderbyte Problem 4 Easy- Letter Challenge
// still need to fix
// 1- finding ampersands in regular expression
// I can hack it with an if statement, but that's sloppy
// 2- special characters are shifting too,
// I want to exit that iteration of the for loop
// and add the special character in question to the new
// array
// 3- refactoring obviously
function main(){
// start
console.log("Enter string");
var str = prompt(" ");
// final output
console.log(LetterChanges(str));
}
function LetterChanges(str){
var strArray = str.split("");
var strNewArray = [];
for(var i = 0; i < strArray.length; i++) {
if (strArray[i].match(/[^\w]+/g) === true){
strNewArray.push(strArray[i]);
break;
} else if (strArray[i] === " ") {
strNewArray.push(" ");
continue;
} else {
var character = strArray[i].charCodeAt(0);
character += 1;
character.toString();
character1 = String.fromCharCode(character);
strNewArray.push(character1);
}
}
return strNewArray.join("");
}
main();
'''
/regex/.test(stringToTest)
so for example:
[1,2,3].map(function(num){
return num + 5;
});
this will return [6,7,8]
String.charCodeAt(0)
to shift
@tesla809 awesome. There's a RegEx joke:
Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.
if (/(\W)/g.test(strArray[i]) === true || /([0-9])/g.test(strArray[i]) === true){
// some code
}
/(\W)/g
into /\W/g
nothing will change
g
flag in this case either, you're only matching a single character after all
/[\W0-9]/.test(str) === true
is equivalent to what you wrote
/[^a-z]/
in my solution for this challenge, but I kept a boolean for uppercase
<button class="flash">Exit</button>
sure, np
ok if I have no regular text and key in three back tics it automatically shift key boards to enter code
code here