var Questions

4

Solved

I have written Red–black tree in Kotlin. Fun insertFixup restores balance after inserting new element (z: Node? is new element). Algorithm of tree balancing is taken from here (pages 2-3). The prob...
Legging asked 1/3, 2017 at 19:9

2

I am getting a TypeError in my variable assignment for mongodb connection. Is there a workaround for this? //server.js var mongoose = require('mongoose'); var config = require('./config'); var { ...
Maldon asked 19/4, 2018 at 13:0

1

Solved

I've been using dart for some time and just wonder about the preference for not type annotating, I personally find it easier to understand and go back through my code if I can see type annotations ...
Ignatz asked 8/10, 2020 at 10:27

9

Solved

I have a variable activeUserName and a variable manager1. How can I check if activeUserName contains at least three characters, that are in manager1? (The position of those characters doesn't matte...
Nurserymaid asked 7/8, 2020 at 15:1

2

I'm trying to make a View that will put a Blur() at the bottom of an iPhone layout, respecting safeareas and that I can easily reuse. Something like this: import SwiftUI struct SafeBottomBlurConta...
Cernuous asked 12/7, 2020 at 11:9

7

Solved

I have this problem with po in the console where trying to output a function works in itself, but outputting a variable or constant doesn't. As you can see here, although you'd think the var/let...
Muscovado asked 13/2, 2015 at 10:31

1

Solved

C#9 was officially announced a couple days ago. One new language features is "target-typed new expressions", which feel pretty similar in usage to var. Comparing the following declarations, I'm cur...
Trimble asked 21/5, 2020 at 17:19

2

Solved

A friend of mine noticed that var<Integer> list = new ArrayList<Double>(); was valid in Java. It turns out that the type of list is evaluated to ArrayList<Double>. When usi...
Amylase asked 21/2, 2020 at 0:51

5

Solved

I'm already aware of how private(set) works. But the below code is give compile-time error, class Person { private(set) let name: String //Error. private(set) let age: Int //Error. init(name: ...
Bountiful asked 28/2, 2020 at 6:20

4

Solved

Why does var allow duplicate declaration but why does const and let not allow duplicate declaration? var is allow duplicate declaration xx=1; xx=2; console.log(xx+xx);//4 var xx=1; var...
Shavers asked 7/3, 2018 at 9:15

5

Solved

What is the difference between foreach ($my_array as $my_value) { } And: foreach ($my_array as &$my_value) { } ? May I ask you to give me two real-world examples of when to use one and w...
Fungible asked 29/12, 2010 at 15:16

3

Solved

I run into the same error over and over again within the debugger, "SyntaxError: missing ) after formal parameters". Here are my parameters I set: var CircleOptions = { posBall: { x: 160, y: ...
Sweitzer asked 16/1, 2014 at 19:58

2

Solved

Can someone explain the behavior of o2? Is it due to compiler optimization? Is it documented somewhere in the JLS? public class Test { public static void main(String[] args) { Object o1 = new Ob...
Meggs asked 11/12, 2019 at 9:23

5

Solved

func main(){ var array [10]int sliceA := array[0:5] append(sliceA, 4) fmt.Println(sliceA) } Error : append(sliceA, 4) evaluated but not used I don't Know why? The slice append operation i...
Baseborn asked 10/7, 2017 at 6:12

4

Solved

I want to use Lazy initialization for some of my properties in Swift. My current code looks like this: lazy var fontSize : CGFloat = { if (someCase) { return CGFloat(30) } else { return CGFloa...
Accomplice asked 11/1, 2015 at 10:24

1

Basically every tutorial I’ve watched on Node.js, and even the express generator has all variables declared using var instead of let? From what I’ve learned in Javascript.info let should be the sta...
Oleoresin asked 16/9, 2019 at 6:0

1

Solved

var is not very handful when you're navigating through the code and investigating the code which is not clear at the first look. When developers use not self-describing methods names you have...
Medici asked 6/8, 2019 at 13:11

2

If we declare a variable and a function with same name, it is accepting re-declaration. But when we do the same thing inside a block, it shows re-declaration error. Code: var x; function x() ...
Secundine asked 12/7, 2019 at 12:11

12

Solved

Earlier I asked a question about why I see so many examples use the varkeyword and got the answer that while it is only necessary for anonymous types, that it is used nonetheless to make writing co...
Ground asked 10/12, 2008 at 17:19

3

Solved

I'm a beginner and I sort of understand Lazy Var vs. Let. I've noticed that it saves a ton of memory usage when using Lazy Var especially with ImageViews. But the tutorials and guides I've seen so ...
Zymometer asked 18/11, 2017 at 15:2

4

Solved

What API in mailchimp should I use to set a merge var value for a specific list member? If I'm adding a new list member, I can use lists/subscribe to set a merge var value for that new member. Ho...
Begotten asked 7/8, 2015 at 22:34

3

Solved

I have big html document with various images with href and src. I want to declare their href and src so as to change only their var values. something like... <script> var imagehr...
Funest asked 12/3, 2019 at 14:21

2

Solved

Why am I able to declare a var multiple times? I would expect an error. This code raises an error: let a = true; let a = false; Uncaught SyntaxError: Identifier 'a' has already been decla...
Chun asked 19/2, 2019 at 7:33

1

Solved

Please find the code in the image below. 1. Assign the returned value of a function, which throws an error actually, to the variable 'withLet' that declared by using keyword 'let'. 2. call 'withLet...
Flamboyant asked 17/1, 2019 at 8:21

11

Solved

We've all encountered it before, needing to print a variable in an input field but not knowing for sure whether the var is set, like this. Basically this is to avoid an e_warning. <input value=...
Vestment asked 29/4, 2011 at 19:28

© 2022 - 2025 — McMap. All rights reserved.