Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Fernando
@lestairon
If you do, try to run your pen in the chat, look what happens
pragya1248
@pragya1248
yes i have
Fernando
@lestairon
When you try to scroll, the box is fixed to a position
pragya1248
@pragya1248
yes it is
Fernando
@lestairon
see?
pragya1248
@pragya1248
yeah
Is it good for a home page?? I am making it first time.So don't have much idea.
Fernando
@lestairon
Making it fixed?
If you make it fixed it wil overlap some text
Why is not working the toggle method? :worried:
Aditya
@ezioda004
@lestairon Which toggle method?
#cof event listener?
Fernando
@lestairon
?
Makarenkov Aleksandr
@trustedperson
Hi all!
Maybe someone can help me with my problem.
I need a mapped image, like this http://www.nevscom.ru/projects/ladozhsky-bereg/plan/?b=2&f=13 (see, plan with highlighted rooms).
First part i have done already - i created mapped image, and it works perfectly, and on hover user sees popup, all fine.
But i cant understand, how make highlighted areas? I tried canvas over my image, but in this case 'mouse hover' dosn`t work.
Can someone share solution?
Aditya
@ezioda004
@lestairon Nevemind I missed it, toggle() method has been removed from 1.9 and above
steve84
@raynor84
hi all, I'm stuck with the exercise diff two arrays
Fernando
@lestairon
Oh
So, what can i use instead?
Stephen James
@sjames1958gm
@raynor84 What code do you have?
steve84
@raynor84
don't have any I'm stuck on how to approach the algorithm
Fernando
@lestairon
I guess the best option now is make 2 if statements that check if the temperature is being displayed in ºC or ºF, right?
Stephen James
@sjames1958gm
@raynor84
Maybe start with trying to find all the values in arr1 not in arr2, using the suggested links.
@lestairon You would have to do that anyway so that you calculated the correct temperature.
Stephen James
@sjames1958gm
@lestairon I would create a variable
var isCelsius = true;
Then use that in your click handler
if (isCelsius) {
   // Change the display to F
   isCelsius = false;
}
else 
{
  // Change the display to C
  isCelsius = true;
}
steve84
@raynor84
still testing it though....

function diffArray(arr1, arr2) {
var newArr = [];
arr1.forEach(function(array, index) {
if(array[index]==arr2[index]) {
newArr = arr1.slice(index-1,index);
console.log(arr1.slice(index-1, index));
}
});

// Same, same; but different.
return newArr;
}

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);

Stephen James
@sjames1958gm
@raynor84 The function called by forEach is not called with an array it is called with a value from the array
arr1.forEach(function(value, index) {})
So you should be testing if value is in arr2 (irrespective of index) (consider indexOf function
steve84
@raynor84
'''
CamperBot
@camperbot
:bulb: to format code use backticks! ``` more info
steve84
@raynor84

'''

function diffArray(arr1, arr2) {
var newArr = [];
arr1.forEach(function(value, index) {
if(value==arr2[index]) {
newArr = arr1.slice(arr1.indexOf(value),arr1.indexOf(value) - 1);
}
});

// Same, same; but different.
return newArr;
}

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
'''

CamperBot
@camperbot
:bulb: to format code use backticks! ``` more info
steve84
@raynor84

function diffArray(arr1, arr2) {
  var newArr = [];
 arr1.forEach(function(value, index) {
   if(value==arr2[index]) {
     newArr = arr1.slice(arr1.indexOf(value),arr1.indexOf(value) - 1);
   }
 });


  // Same, same; but different.
  return newArr;
}

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Stephen James
@sjames1958gm
@raynor84 Doesn't that just compare value to one value in arr2? You are resetting newArr with each iteration.
Consider arr2.indexOf(value) and how the value from this might be useful
steve84
@raynor84
the index should be index++ next iteration
Juli Cheng
@julicheng
hi guys would really appreciate if someone could help with my question. so im looking at a js file and this is at the top
import $ from 'jquery' import TweenMax from 'gsap'
what does it mean and is it vanilla js? i know it says its importing jquery and tweenmax but ive never seen this syntax before. thanks!
Fernando
@lestairon
That looks like python lol, but yeah, i've never seen that syntax in js
Stephen James
@sjames1958gm
@julicheng
It is the new module syntax
@julicheng It doesn't have a lot of browser support yet, so you will see that code converted by tools like babel on the server before being
sent to the browser
@raynor84 I am going to say you don't really need the index at all, if a value from arr1 is not in arr2, simply add the value to newArr
Fernando
@lestairon
@sjames1958gm Why arent we using Ecmascript 6 instead of Js?
steve84
@raynor84
'''
CamperBot
@camperbot
:bulb: to format code use backticks! ``` more info
Stephen James
@sjames1958gm
@lestairon ecmascript is the specification, javascript is the implementation of ecmascript
Andrew Marushko
@andrewmarushko

Hi all.
i had a question.
I have array of objects for example

var someArray = [{name: ‘one'}, {name: ’two'}, {name: ’three’}]

how i can add for example field id: 1 for each of objects in array
output must be something like this

var someArray = [{name: ‘one’, id: 1}, {name: ’two’, id: 2}, {name: ’three’, id: 3}]

steve84
@raynor84

function diffArray(arr1, arr2) {
  var newArr = [];
 arr1.forEach(function(value, index) {
   if(value!=arr2[index]) {
     newArr.push(arr2[index]);
   }
 });


  // Same, same; but different.
  return newArr;
}

diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
Fernando
@lestairon
Yeah, but i mean the newer vesion