These are chat archives for FreeCodeCamp/Help

23rd
May 2018
1LifeLess
@1LifeLess
May 23 2018 00:50
Hi, Is there a way in JS to use Max function to retrieve more than 1 number, like returning an array of max X numbers
Moisés Man
@moigithub
May 23 2018 01:00

depends on input.. u will need to combine some other methods.. but yes @1LifeLess
[[1,2,3],[4,5,6],[7,8,9]].map(a=>Math.max(...a))

[3, 6, 9]

Henry
@GitHub-Henry
May 23 2018 02:17
@moigithub :+1:
Kyle Holm
@thekholm80
May 23 2018 02:47
@kdeleteme awesome, glad you got it sorted out
jijinsen
@jjslovelsq
May 23 2018 06:55
字号 font-size咋添加。。。求大佬们指导
idapao
@idapao
May 23 2018 07:04
你的 div 元素应该包含类属性 container-fluid.
确保你的每一个 div 元素都有一个闭合标签.
确保你已经将所有HTML元素内嵌在 .container-fluid 之中.
不明白
Bjorn van de Peut
@bjorno43
May 23 2018 07:08
@jjslovelsq @idapao You guys will most likely find better help in our Chinese room: https://gitter.im/FreeCodeCamp/chinese?source=orgpage
jijinsen
@jjslovelsq
May 23 2018 07:55
thank you@bjorno43
18375954724
@18375954724
May 23 2018 08:34
var s = "_" + Math.random().toString(36).slice(2);
var mul = document.getElementById("top-nav");
var mli =mul.getElementsByTagName("li");
for (var i=0;i<mli.length;i++) {
var mz = mli[i].getAttribute("alt");
mli[i].onclick = function(){
console.log(i);
}
}
为什么我的循环出来onclick无效呢
Dimitris Nik.
@dimitrissnk
May 23 2018 08:35
Hey guys, can you give me some good and free services to host my page images? I want it to be supported by codepen! I have used google drive but my sharable image link stops working after a couple of hours/days
May Kittens Devour Your Soul
@diomed
May 23 2018 09:05
@Dimitrios51 Cloudinary
kisasexypantera94
@kisasexypantera94
May 23 2018 09:08
is it a better practice to wrap every line with bootstrap's .row?
Henry
@GitHub-Henry
May 23 2018 09:14
ckcoska
@ckcoska
May 23 2018 11:21
Hi guys, how can I identify the way to apply about functions such as .replace() and .push() ?
ckcoska
@ckcoska
May 23 2018 11:26
Sometimes I would have written as "a.replace(...);" instead of "a=a.replace(...);", and I figure out for a while just realize I should've written as a latter one and that always wastes my time.
Stephen James
@sjames1958gm
May 23 2018 12:16
@ckcoska If you go to MDN it will tell you what the function returns
@ckcoska For string functions, they will always return a new string and never modify an existing one
May Kittens Devour Your Soul
@diomed
May 23 2018 12:30
and today... in our lit css class
classes 1x01
.🦄 {
  display: flex;
  align-items: center;
  justify-content: center;
}
.🖼️ {border: 1px solid #eee}
ckcoska
@ckcoska
May 23 2018 13:55
@sjames1958gm thank you
CamperBot
@camperbot
May 23 2018 13:55
ckcoska sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 9253 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
1LifeLess
@1LifeLess
May 23 2018 13:57
Hi, Can i use JS Reduce and set the start index by myself?
C C Darshan Thimmaiah
@darshancc23
May 23 2018 14:02
Hi guys, It's the end of the semester here and I have to choose the electives for the next semester. I want to be a full stack web developer and am also interested in blockchain and dApps. So I'm having a tough time choosing between "digital image processing" and "storage area network". Could you guys help me out?
Kyle Holm
@thekholm80
May 23 2018 14:03
@1LifeLess i don't think you can set the starting index, but you can get the current index in the callback and just bypass until you hit the index value you want
array.reduce((accumulator, current, index, copyOfArray) => {
  if (index < whateverNumber) return accumulator;
});
May Kittens Devour Your Soul
@diomed
May 23 2018 14:05
@darshancc23 digital image processing sounds like a joke compared to storage area network
C C Darshan Thimmaiah
@darshancc23
May 23 2018 14:08
@diomed Can you explain why? :sweat_smile:
May Kittens Devour Your Soul
@diomed
May 23 2018 14:10
@thekholm80 can explain . he's a system analitics manager in Microsoft
he's also proficient in statistical analysis and data reconfiguration
Kyle Holm
@thekholm80
May 23 2018 14:11
if by 'system analitics manager' you mean pee-on and 'Microsoft' you mean another, non-tech company - then yes, yes i am
May Kittens Devour Your Soul
@diomed
May 23 2018 14:12
@darshancc23 digital image processing sounds like a course for millenials, where storage area network sounds like something that you can actually have use of afterwards
C C Darshan Thimmaiah
@darshancc23
May 23 2018 14:15
@diomed Thx a lot man!!
CamperBot
@camperbot
May 23 2018 14:15
darshancc23 sends brownie points to @diomed :sparkles: :thumbsup: :sparkles:
:star2: 5375 | @diomed |http://www.freecodecamp.org/diomed
Thomas Tylek
@zippkidd
May 23 2018 16:28
Anyone here familiar with wordpress header.php files?
Bjorn van de Peut
@bjorno43
May 23 2018 16:30
@zippkidd You're much more likely to find help with backend projects in our HelpBackEnd room: https://gitter.im/FreeCodeCamp/HelpBackEnd That being said, I know very little about WordPress, but I'm very formilliar with PHP. Perhaps I can help out?
Thomas Tylek
@zippkidd
May 23 2018 16:31
Thanks but it's very wordpress specific. The template I'm working with is generating a link around an element for some reason and I can't figure out why for the life of me
Jimmy Pham
@jpham197
May 23 2018 19:36
Hi, I'm not sure if the FCC Gitter is the right place to ask this so sorry if this doesn't fit in here but I'm confused about Angular and why it uses app.component.html instead of index.html, what's the point of having index.html there if it isn't used?
Gulsvi
@gulsvi
May 23 2018 19:40
@jpham197 We don't learn Angular in Free Code Camp, you may want to try one of the Gitter Angular rooms, like: https://gitter.im/angular/angular
Jimmy Pham
@jpham197
May 23 2018 19:41
Ah yes, thank you!
Kingsley
@Kingwindie
May 23 2018 21:12
how can i make the select display in the input value field?
<label for="weather">Select the weather type today:</label>
        <select id="weather">
            <option value="">--Select--</option>
            <option value="Sunny">Sunny</option>
            <option value="Rainy">Rainy</option>
            <option value="Snowing">Snowing</option>
            <option value="Overcast">Overcast</option>
        </select>
        <input type="text" id="weatherInput">
        <p id="weatherP"></p>
var select = document.querySelector("select");
var p = document.querySelector("#weatherP");
var weatherInput = document.querySelector("#weatherInput");

select.addEventListener("change", setWeather);

function setWeather() {
    var choice = select.value; 

    if (choice === "Sunny") {
        p.textContent = "It is nice and sunny today";
        weatherInput.value = choice;
Gulsvi
@gulsvi
May 23 2018 21:47
@Kingwindie This tutorial may help you get that going: https://www.w3schools.com/howto/howto_js_autocomplete.asp
If you don't mind jQuery, the jQuery-UI library has an autocomplete feature
Kingsley
@Kingwindie
May 23 2018 21:47
@gulsvi thank you,i will look at it
CamperBot
@camperbot
May 23 2018 21:47
kingwindie sends brownie points to @gulsvi :sparkles: :thumbsup: :sparkles:
:star2: 2727 | @gulsvi |http://www.freecodecamp.org/gulsvi
1LifeLess
@1LifeLess
May 23 2018 22:29
@thekholm80 i see, thanks man
CamperBot
@camperbot
May 23 2018 22:29
1lifeless sends brownie points to @thekholm80 :sparkles: :thumbsup: :sparkles:
:star2: 1792 | @thekholm80 |http://www.freecodecamp.org/thekholm80
Kyle Holm
@thekholm80
May 23 2018 22:58
@1LifeLess :+1:
1LifeLess
@1LifeLess
May 23 2018 22:59
@thekholm80 I used slice() and then reduce() i sliced all elements i wanted to skip
Kyle Holm
@thekholm80
May 23 2018 22:59
that's probably a better approach
but, it's handy to know the index is there if you need it
1LifeLess
@1LifeLess
May 23 2018 23:00
yeah i knew, but developer.mozilla says anything about changing it
aven877
@aven877
May 23 2018 23:12
anyone on?