function myReplace(str, before, after) {
return str.replace (before, function(){
if (before.charAt(0).toUpperCase()){
return after.charAt(0).toUpperCase()+ after.slice(1);
} else if (before.charAt(0).toLowerCase()){
return after;
}
});
}
myReplace("Let us go to the store", "store", "mall");
"A"
or some capital letter so it will always be true
(before.charAt(0)== before.charAt(0).toUpperCase())
rafaelmonroy sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1737 | @heroiczero |http://www.freecodecamp.com/heroiczero
overflow-y: hidden
fredrikoseberg sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 1738 | @heroiczero |http://www.freecodecamp.com/heroiczero
$("#getTweet").on("click", function(){
randomText = randomText.slice(3, randomText.length-5)
window.open("https://twitter.com/intent/tweet?text="+randomText
)
});
else {
var logo= "https://res.cloudinary.com/mers/image/upload/c_scale,w_175/v1504573315/ui-day033-404error_u37kee.png";
$("#logo")
.append("<img class='logo_row' src='"+ logo + "'>") ;
$("#displayname")
.append('<div class="status_row">' + "</div>");
$("#status")
.append('<div class="status_row">' + "</div>");
}});
.status_row {
overflow: auto;
}
iloveimages sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 427 | @gothamknight |http://www.freecodecamp.com/gothamknight
function sumFibs(num) {
var arr = [];
for (var i=1; i<num; i++) {
arr.push(i);
}
return arr;
}
sumFibs(4);
$("#getQuote").on("click", function() {
$.ajaxSetup({ cache: false });
$.getJSON(
"https://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&callback=",
function(
data //@ILoveImages your url is http. codepen is served over https so the url can't work
) {
$(".quoteText").html(data[0].content);
randomText = data[0].content
$(".quoteTitle").html(data[0].title);
var newColor = [];
//var delayMillis = 100000000000000;
var newColorQuote = document.getElementById("changedQuote");
var newColorAuthor = document.getElementById("changedAuthor");
var newColorButton = document.getElementById("getQuote");
var newColorTweet = document.getElementById("getTweet");
newColor = generateColor();
document.body.style.backgroundColor = 'rgb(' + newColor[0] + ', ' + newColor[1] + ',' + newColor[2] + ')'; //why do I have to add + opperator and what they do actually?
newColorQuote.style.color = 'rgb(' + newColor[0] + ', ' + newColor[1] + ',' + newColor[2] + ')';
newColorAuthor.style.color = 'rgb(' + newColor[0] + ', ' + newColor[1] + ',' + newColor[2] + ')';
newColorButton.style.color = 'rgb(' + newColor[0] + ', ' + newColor[1] + ',' + newColor[2] + ')';
newColorTweet.style.color = 'rgb(' + newColor[0] + ', ' + newColor[1] + ',' + newColor[2] + ')';
});
});
forkerino sends brownie points to @iangracia :sparkles: :thumbsup: :sparkles:
:cookie: 320 | @iangracia |http://www.freecodecamp.com/iangracia
forkerino sends brownie points to @iangracia :sparkles: :thumbsup: :sparkles:
:cookie: 322 | @iangracia |http://www.freecodecamp.com/iangracia
https://codepen.io/moT01/pen/LzpGNG?editors=1010
i got it working another way
str = 'something'+myVar+'somemore'
function getLocation() {
var latitude = 35;
var longitude = 35;
getWeather(latitude, longitude);
}
function getWeather(latitude, longitude) {
console.log(latitude) // 35
console.log(longitude) // 35
}
'httplink'+latitude+'more of the link'+longitude+'more of the link'
norrismi sends brownie points to @piteto and @janshah :sparkles: :thumbsup: :sparkles:
:cookie: 112 | @piteto |http://www.freecodecamp.com/piteto
:cookie: 526 | @janshah |http://www.freecodecamp.com/janshah
Here's what I have: var total = 1;
function factorialize(num) {
for (i = 1; i <= num; i++) {
total *= i;
}
return total;
}
factorialize(5);
mitchell0625 sends brownie points to @orangekulture :sparkles: :thumbsup: :sparkles:
:cookie: 466 | @orangekulture |http://www.freecodecamp.com/orangekulture
((\(\d{3}\))|\d{3})
- which is basically a grouped expression where you either have three digits - the part that is \d{3}
either surrounded by parentheses or not surrounded by parentheses. the vertical bar |
separates those two conditions.
footer a {}
in your css
<a>
isnt in the <footer>
0
in your css, there's no need to specify the units. 0px
can just be 0
. Also, it's a good practice to define a default font size when using em/rem units
koderkid1936 sends brownie points to @piteto :sparkles: :thumbsup: :sparkles:
:cookie: 113 | @piteto |http://www.freecodecamp.com/piteto
arrudamt sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 428 | @gothamknight |http://www.freecodecamp.com/gothamknight
#title
:cookie: 494 | @korzo |http://www.freecodecamp.com/korzo
arrudamt sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
var weatherType = data.weather[0].description;
ophellia sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 495 | @korzo |http://www.freecodecamp.com/korzo
#title, #subtitle {
color: rgb(230,194,0);
font-family: 'IM Fell Great Primer', serif;
text-align: center;
}
.yellowStyling{
color: rgb(230,194,0);
font-family: 'IM Fell Great Primer', serif;
text-align: center;
}
arrudamt sends brownie points to @koderkid1936 :sparkles: :thumbsup: :sparkles:
:cookie: 257 | @koderkid1936 |http://www.freecodecamp.com/koderkid1936
arrudamt sends brownie points to @koderkid1936 :sparkles: :thumbsup: :sparkles:
var ce = new CalcEval();
()
basically allows the regex to check something and saves the match?